forked from OSchip/llvm-project
[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:
parent
b36cb20ef9
commit
f11cc49f7c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue