summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-05-01 05:41:58 +0000
committerPetr Hosek <phosek@chromium.org>2019-05-01 05:41:58 +0000
commitad3faadc87bf84cbb05bd29e1f014e75dc551e2d (patch)
treed740d4bd5d88a9a4c6798067de8dc35e680888dc /compiler-rt/cmake
parente29e30b1397f3e50f3487491f8a77ae08e4e3471 (diff)
downloadbcm5719-llvm-ad3faadc87bf84cbb05bd29e1f014e75dc551e2d.tar.gz
bcm5719-llvm-ad3faadc87bf84cbb05bd29e1f014e75dc551e2d.zip
[compiler-rt] Cleanup the --target and --sysroot handling
This addresses issue introduced in r359646. llvm-svn: 359650
Diffstat (limited to 'compiler-rt/cmake')
-rw-r--r--compiler-rt/cmake/Modules/AddCompilerRT.cmake7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index 8f49f3e7a90..3970fb4157a 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/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}
OpenPOWER on IntegriCloud