diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/CMakeLists.txt | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index e898800..fbbdfa1 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -138,40 +138,9 @@ if(NOT APPLE) endif() endif() -if(WIN32) - function(handle_gnu_style_compiler) - # No console window when targeting windows - # Supposedly the flag -mwindows would automatically make the executable use GUI subsystem - # But, when subsystem is set to GUI, linker will only search WinMain and wWinMain but not the standard main (it seems like) - # so creating GUI executable fails and the linker silently reverts to the default, CUI subsystem - target_link_options(CpltCore PRIVATE -Wl,-subsystem:windows) - target_link_options(CpltCore PRIVATE -Wl,-entry:mainCRTStartup) - endfunction() - - function(handle_msvc_style_compiler) - # No console window when targeting windows - target_link_options(CpltCore PRIVATE /SUBSYSTEM:windows /ENTRY:mainCRTStartup) - endfunction() - - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # GCC (MinGW) - handle_gnu_style_compiler() - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - if(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") - # MSVC-style argument clang (clang-cl.exe) - handle_msvc_style_compiler() - elseif(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") - # GNU-style argument clang (clang.exe and clang++.exe) - handle_gnu_style_compiler() - endif() - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - handle_msvc_style_compiler() - - # Use updated __cplusplus macro - # https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus - target_compile_options(CpltCore PUBLIC /Zc:__cplusplus) - endif() -endif() +target_flag_exceptions(CpltCore ON) +target_flag_rtti(CpltCore OFF) +target_use_windows_subsystem(CpltCore) if(CMAKE_UNITY_BUILD) message("CpltCore: - using unity build") |