Prepare for clang+mingw windows builds
Use $(prefix)CLANG_SUPPORTED from Soong to control whether to use clang
for host builds or not. It's fairly general, but I only expect it to be
used to so that Windows builds can be switched between GCC and Clang
with a single switch.
Also separate native-host-cross from native-host so that it's easier to
build all possible windows modules.
Bug: 69933068
Test: m native-host-cross
Test: switch clang on and off, grep w64.*g++ out/build-aosp_arm.ninja
Change-Id: I205c5bc6739b72a539ece935381107ec1dd5bd48
diff --git a/core/base_rules.mk b/core/base_rules.mk
index ee3ed6c..91d1534 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -667,7 +667,7 @@
ifdef j_or_n
-$(j_or_n) $(h_or_t) $(j_or_n)-$(h_or_t) : $(my_checked_module)
+$(j_or_n) $(h_or_t) $(j_or_n)-$(h_or_hc_or_t) : $(my_checked_module)
ifneq (,$(filter $(my_module_tags),tests))
$(j_or_n)-$(h_or_t)-tests $(j_or_n)-tests $(h_or_t)-tests : $(my_checked_module)
endif
diff --git a/core/binary.mk b/core/binary.mk
index e54edbe..e50f38c 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -387,9 +387,9 @@
# clang is enabled by default for host builds
# enable it unless we've specifically disabled clang above
ifdef LOCAL_IS_HOST_MODULE
- ifeq ($($(my_prefix)OS),windows)
+ ifneq ($($(my_prefix)CLANG_SUPPORTED),true)
ifeq ($(my_clang),true)
- $(error $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Clang is not yet supported for windows binaries)
+ $(call pretty-error,Clang is not yet supported for $($(my_prefix)OS) binaries)
endif
my_clang := false
else