[compiler-rt] r220522 - 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.

Aaron Ballman aaron at aaronballman.com
Thu Oct 23 15:13:53 PDT 2014


Author: aaronballman
Date: Thu Oct 23 17:13:52 2014
New Revision: 220522

URL: http://llvm.org/viewvc/llvm-project?rev=220522&view=rev
Log:
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.

Modified:
    compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake?rev=220522&r1=220521&r2=220522&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake Thu Oct 23 17:13:52 2014
@@ -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()





More information about the llvm-commits mailing list