[compiler-rt][builtins] Fix CMake builtin target flag

clang-cl doesn't support -target <target>, instead it only supports
--target=<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=<target> instead of the old syntax.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D120308
This commit is contained in:
Tobias Hieta 2022-02-22 09:52:09 +01:00
parent a5bbc6ef99
commit 8182dba0c2
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ function(try_compile_only output)
set(TRY_COMPILE_FLAGS "${ARG_FLAGS}") set(TRY_COMPILE_FLAGS "${ARG_FLAGS}")
if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) 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() endif()
string(REPLACE ";" " " extra_flags "${TRY_COMPILE_FLAGS}") string(REPLACE ";" " " extra_flags "${TRY_COMPILE_FLAGS}")