Skip to content

Commit ad3faad

Browse files
committed
[compiler-rt] Cleanup the --target and --sysroot handling
This addresses issue introduced in r359646. llvm-svn: 359650
1 parent e29e30b commit ad3faad

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler-rt/cmake/Modules/AddCompilerRT.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,11 @@ function(add_compiler_rt_runtime name type)
274274
endif()
275275

276276
if(type STREQUAL "OBJECT")
277-
get_property(cflags_${libname} SOURCE ${sources_${libname}} PROPERTY COMPILE_FLAGS)
278277
if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET)
279-
list(APPEND cflags_${libname} "--target=${CMAKE_C_COMPILER_TARGET}")
278+
list(APPEND extra_cflags_${libname} "--target=${CMAKE_C_COMPILER_TARGET}")
280279
endif()
281280
if(CMAKE_SYSROOT)
282-
list(APPEND cflags_${libname} "--sysroot=${CMAKE_SYSROOT}")
281+
list(APPEND extra_cflags_${libname} "--sysroot=${CMAKE_SYSROOT}")
283282
endif()
284283
string(REPLACE ";" " " extra_cflags_${libname} "${extra_cflags_${libname}}")
285284
string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions
@@ -297,7 +296,7 @@ function(add_compiler_rt_runtime name type)
297296
string(REPLACE "<SOURCE>" "${sources_${libname}}"
298297
compile_command_${libname} ${compile_command_${libname}})
299298
elseif(substitution STREQUAL "<FLAGS>")
300-
string(REPLACE "<FLAGS>" "${CMAKE_C_FLAGS} ${cflags_${libname}} ${extra_cflags_${libname}}"
299+
string(REPLACE "<FLAGS>" "${CMAKE_C_FLAGS} ${extra_cflags_${libname}}"
301300
compile_command_${libname} ${compile_command_${libname}})
302301
else()
303302
string(REPLACE "${substitution}" "" compile_command_${libname}

0 commit comments

Comments
 (0)