[compiler-rt] r355237 - [CMake] Don't use llvm_replace_compiler_option
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 14:30:18 PST 2019
Author: mstorsjo
Date: Fri Mar 1 14:30:17 2019
New Revision: 355237
URL: http://llvm.org/viewvc/llvm-project?rev=355237&view=rev
Log:
[CMake] Don't use llvm_replace_compiler_option
Building compiler-rt standalone outside of the main llvm
tree is supported, and in this case, the llvm cmake modules
are unavailable. (And even if they are available, it requires
including LLVMProcessSources.cmake, which currently isn't
included.)
This fixes building compiler-rt standalone with MSVC/clang-cl.
Differential Revision: https://reviews.llvm.org/D58767
Modified:
compiler-rt/trunk/CMakeLists.txt
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=355237&r1=355236&r2=355237&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Fri Mar 1 14:30:17 2019
@@ -375,9 +375,13 @@ if(MSVC)
# warning from the MS linker complaining that it can't find the 'vc140.pdb'
# file used by our object library compilations.
list(APPEND SANITIZER_COMMON_CFLAGS /Z7)
- llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/Z[i7I]" "/Z7")
- llvm_replace_compiler_option(CMAKE_CXX_FLAGS_DEBUG "/Z[i7I]" "/Z7")
- llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z[i7I]" "/Z7")
+ foreach(var_to_update
+ CMAKE_CXX_FLAGS
+ CMAKE_CXX_FLAGS_DEBUG
+ CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+ string(REGEX REPLACE "(^| )/Z[i7I]($| )" " /Z7 "
+ "${var_to_update}" "${${var_to_update}}")
+ endforeach()
elseif(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG)
list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only)
elseif(COMPILER_RT_HAS_G_FLAG)
More information about the llvm-commits
mailing list