[CMake] Properly quote string arguments to quiet errors from r327528 when built

with LLVM_ENABLE_EH and LLVM_ENABLE_RTTI.

llvm-svn: 327531
This commit is contained in:
Frederich Munch 2018-03-14 16:56:02 +00:00
parent b36cb20ef9
commit f11cc49f7c
1 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@ function(clang_enable_exceptions TARGET)
# of how LLVM is being built.
if (NOT LLVM_REQUIRES_EH AND NOT LLVM_REQUIRES_RTTI)
if (MSVC)
# /EHs to allow throwing rom extern "C"
# /EHs to allow throwing from extern "C"
set(excptnExceptions_ON "/D _HAS_EXCEPTIONS=1 /EHs /wd4714")
set(excptnExceptions_OFF "/D _HAS_EXCEPTIONS=0 /EHs-c-")
set(excptnRTTI_ON "/GR")
@ -68,14 +68,14 @@ function(clang_enable_exceptions TARGET)
# Strip the exception & rtti flags from the target
get_property(addedFlags TARGET ${TARGET} PROPERTY COMPILE_FLAGS)
string(REGEX REPLACE ${excptnEHRTTIRegEx} "" editedFlags ${addedFlags})
string(REPLACE ${excptnRTTI_OFF} "" editedFlags ${editedFlags})
set_property(TARGET ${TARGET} PROPERTY COMPILE_FLAGS ${editedFlags})
string(REGEX REPLACE ${excptnEHRTTIRegEx} "" editedFlags "${addedFlags}")
string(REPLACE ${excptnRTTI_OFF} "" editedFlags "${editedFlags}")
set_property(TARGET ${TARGET} PROPERTY COMPILE_FLAGS "${editedFlags}")
get_property(addedFlags TARGET ${TARGET} PROPERTY COMPILE_DEFINITIONS)
string(REGEX REPLACE ${excptnEHRTTIRegEx} "" editedFlags ${addedFlags})
string(REPLACE ${excptnRTTI_OFF} "" editedFlags ${editedFlags})
set_property(TARGET ${TARGET} PROPERTY COMPILE_DEFINITIONS ${editedFlags})
string(REGEX REPLACE ${excptnEHRTTIRegEx} "" editedFlags "${addedFlags}")
string(REPLACE ${excptnRTTI_OFF} "" editedFlags "${editedFlags}")
set_property(TARGET ${TARGET} PROPERTY COMPILE_DEFINITIONS "${editedFlags}")
# Re-add the exception & rtti flags from LLVM
set_property(SOURCE main.cpp APPEND_STRING PROPERTY COMPILE_FLAGS