diff options
author | Martin Storsjo <martin@martin.st> | 2019-03-01 22:30:17 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-03-01 22:30:17 +0000 |
commit | ad596c8d8c4f4744bcb8c14977987f01d5b99ef3 (patch) | |
tree | 465d4d51936f1d404986aa1f249bdcf6baa1b5c9 /compiler-rt | |
parent | 05394af3ffd91ceceabb5e28e47ab0976471b8df (diff) | |
download | bcm5719-llvm-ad596c8d8c4f4744bcb8c14977987f01d5b99ef3.tar.gz bcm5719-llvm-ad596c8d8c4f4744bcb8c14977987f01d5b99ef3.zip |
[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
llvm-svn: 355237
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/CMakeLists.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 2c530f5f099..612f4e1fe3a 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -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) |