diff options
author | Petr Hosek <phosek@chromium.org> | 2019-05-01 05:41:58 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-05-01 05:41:58 +0000 |
commit | 22b412f45cc2a6f03b33e1ed59d2ee4a65a8be4a (patch) | |
tree | fff51eea023b7a2d03a586f3e476456aec135093 | |
parent | 8bff215cea06b2a2a25fe7680a40bf9f85b78d5d (diff) | |
download | compiler-rt-22b412f45cc2a6f03b33e1ed59d2ee4a65a8be4a.tar.gz |
[compiler-rt] Cleanup the --target and --sysroot handling
This addresses issue introduced in r359646.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359650 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | cmake/Modules/AddCompilerRT.cmake | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index 8f49f3e7a..3970fb415 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -274,12 +274,11 @@ function(add_compiler_rt_runtime name type) endif() if(type STREQUAL "OBJECT") - get_property(cflags_${libname} SOURCE ${sources_${libname}} PROPERTY COMPILE_FLAGS) if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) - list(APPEND cflags_${libname} "--target=${CMAKE_C_COMPILER_TARGET}") + list(APPEND extra_cflags_${libname} "--target=${CMAKE_C_COMPILER_TARGET}") endif() if(CMAKE_SYSROOT) - list(APPEND cflags_${libname} "--sysroot=${CMAKE_SYSROOT}") + list(APPEND extra_cflags_${libname} "--sysroot=${CMAKE_SYSROOT}") endif() string(REPLACE ";" " " extra_cflags_${libname} "${extra_cflags_${libname}}") string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions @@ -297,7 +296,7 @@ function(add_compiler_rt_runtime name type) string(REPLACE "<SOURCE>" "${sources_${libname}}" compile_command_${libname} ${compile_command_${libname}}) elseif(substitution STREQUAL "<FLAGS>") - string(REPLACE "<FLAGS>" "${CMAKE_C_FLAGS} ${cflags_${libname}} ${extra_cflags_${libname}}" + string(REPLACE "<FLAGS>" "${CMAKE_C_FLAGS} ${extra_cflags_${libname}}" compile_command_${libname} ${compile_command_${libname}}) else() string(REPLACE "${substitution}" "" compile_command_${libname} |