[compiler-rt] r359650 - [compiler-rt] Cleanup the --target and --sysroot handling
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 30 22:41:58 PDT 2019
Author: phosek
Date: Tue Apr 30 22:41:58 2019
New Revision: 359650
URL: http://llvm.org/viewvc/llvm-project?rev=359650&view=rev
Log:
[compiler-rt] Cleanup the --target and --sysroot handling
This addresses issue introduced in r359646.
Modified:
compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=359650&r1=359649&r2=359650&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Tue Apr 30 22:41:58 2019
@@ -274,12 +274,11 @@ function(add_compiler_rt_runtime name ty
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 ty
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}
More information about the llvm-commits
mailing list