From 06ff1fdd4fc8bb048458ca13d153786d039f0715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sat, 29 Apr 2023 22:26:35 +0300 Subject: [PATCH] Revert "build-compiler-rt: Stop setting CMAKE_*_COMPILER_WORKS" This reverts commit 056cb22fb537e392d525b869f92699441704a78b. The fix for avoiding needing to set CMAKE_*_COMPILER_WORKS, which means setting CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY when intiailizing the CMake project setup, was only possible to apply on compiler-rt/lib/builtins, not other similar projects like libunwind/libcxxabi/libcxx - so it's expected to keep needing to set the CMAKE_*_COMPILER_WORKS flags. Therefore it's also possible that the code in compiler-rt/lib/builtins could be reverted, as it does have some other minor inconveniences (it causes some other feature detections to fail, even if they're harmless within the builtins). Thus keep setting CMAKE_*_COMPILER_WORKS everywhere consistently. --- build-compiler-rt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-compiler-rt.sh b/build-compiler-rt.sh index f98b7b7..38e3cde 100755 --- a/build-compiler-rt.sh +++ b/build-compiler-rt.sh @@ -110,6 +110,8 @@ for arch in $ARCHS; do -DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_AR="$PREFIX/bin/llvm-ar" \ -DCMAKE_RANLIB="$PREFIX/bin/llvm-ranlib" \ + -DCMAKE_C_COMPILER_WORKS=1 \ + -DCMAKE_CXX_COMPILER_WORKS=1 \ -DCMAKE_C_COMPILER_TARGET=$arch-windows-gnu \ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE \ -DCOMPILER_RT_USE_BUILTINS_LIBRARY=TRUE \