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/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