Cmake variables are global, which is why we would get crud like /machine:X86 in the list of compiler options for MSVC. Clear out the variable before attempting to enumerate arguments and set them.

llvm-svn: 220522
This commit is contained in:
Aaron Ballman 2014-10-23 22:13:52 +00:00
parent 03478d952d
commit e927a17022
1 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@
# define a handy helper function for it. The compile flags setting in CMake
# has serious issues that make its syntax challenging at best.
function(set_target_compile_flags target)
set(argstring "")
foreach(arg ${ARGN})
set(argstring "${argstring} ${arg}")
endforeach()
@ -9,6 +10,7 @@ function(set_target_compile_flags target)
endfunction()
function(set_target_link_flags target)
set(argstring "")
foreach(arg ${ARGN})
set(argstring "${argstring} ${arg}")
endforeach()