From 8182dba0c2981690dda3cb8be6e4ec085bf9b2a1 Mon Sep 17 00:00:00 2001 From: Tobias Hieta Date: Tue, 22 Feb 2022 09:52:09 +0100 Subject: [PATCH] [compiler-rt][builtins] Fix CMake builtin target flag clang-cl doesn't support -target , instead it only supports --target= so building a RUNTIME configuration for clang-cl ended up in never building builtins. Which in turn lead to clang-cl not being able to find the runtime libraries because we depend on the compiler_rt.builtins.lib being in the runtime dir for the Driver to add it as a candidate. I don't think this should have any downsides since most the code these days are using --target= instead of the old syntax. Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D120308 --- compiler-rt/cmake/Modules/BuiltinTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/cmake/Modules/BuiltinTests.cmake b/compiler-rt/cmake/Modules/BuiltinTests.cmake index 904904d545a5..7d71ca3f71ef 100644 --- a/compiler-rt/cmake/Modules/BuiltinTests.cmake +++ b/compiler-rt/cmake/Modules/BuiltinTests.cmake @@ -46,7 +46,7 @@ function(try_compile_only output) set(TRY_COMPILE_FLAGS "${ARG_FLAGS}") if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) - list(APPEND TRY_COMPILE_FLAGS "-target ${CMAKE_C_COMPILER_TARGET}") + list(APPEND TRY_COMPILE_FLAGS "--target=${CMAKE_C_COMPILER_TARGET}") endif() string(REPLACE ";" " " extra_flags "${TRY_COMPILE_FLAGS}")