diff options
author | Brad King <brad.king@kitware.com> | 2020-11-13 15:50:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-13 15:50:25 (GMT) |
commit | 6114c8e994761ae4873218499a951136a4cdd855 (patch) | |
tree | 86d275172b656e8e69a004622a108b094428a814 /Modules/Platform | |
parent | 225fb10f67afe474e017e6b9b2a53e239f004ec8 (diff) | |
download | CMake-6114c8e994761ae4873218499a951136a4cdd855.zip CMake-6114c8e994761ae4873218499a951136a4cdd855.tar.gz CMake-6114c8e994761ae4873218499a951136a4cdd855.tar.bz2 |
MSVC: Factor out initialization of /GR flag
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index bd08718..cf3e3eb 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -163,6 +163,8 @@ foreach(lang C CXX) endif() endforeach() +set(_GR " /GR") + if(WINCE) foreach(lang C CXX) string(TOUPPER "${_MSVC_${lang}_ARCHITECTURE_FAMILY}" _MSVC_${lang}_ARCHITECTURE_FAMILY_UPPER) @@ -182,7 +184,7 @@ if(WINCE) set(_RTC1 "") set(_FLAGS_C "") - set(_FLAGS_CXX " /GR /EHsc") + set(_FLAGS_CXX "${_GR} /EHsc") foreach(lang C CXX) if(_MSVC_${lang}_ARCHITECTURE_FAMILY STREQUAL "ARM") @@ -204,7 +206,7 @@ if(WINCE) elseif(WINDOWS_PHONE OR WINDOWS_STORE) set(_PLATFORM_DEFINES "/DWIN32") set(_FLAGS_C " /DUNICODE /D_UNICODE") - set(_FLAGS_CXX " /DUNICODE /D_UNICODE /GR /EHsc") + set(_FLAGS_CXX " /DUNICODE /D_UNICODE${_GR} /EHsc") if(WINDOWS_STORE AND MSVC_VERSION GREATER 1899) set(CMAKE_C_STANDARD_LIBRARIES_INIT "WindowsApp.lib") elseif(WINDOWS_PHONE) @@ -226,12 +228,12 @@ else() set(_FLAGS_CXX " -frtti -fexceptions") else() set(_RTC1 "/RTC1") - set(_FLAGS_CXX " /GR /EHsc") + set(_FLAGS_CXX "${_GR} /EHsc") endif() set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib") else() set(_RTC1 "/GZ") - set(_FLAGS_CXX " /GR /GX") + set(_FLAGS_CXX "${_GR} /GX") set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") endif() @@ -241,6 +243,8 @@ else() endif() endif() +unset(_GR) + set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags |