mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 07:39:26 +01:00
cmake: enable same conformance-related flags as msbuild
This commit is contained in:
parent
f018d69bff
commit
fffe2c0a2b
@ -217,6 +217,15 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|||||||
check_and_add_flag(EXCEPTIONS /EHsc)
|
check_and_add_flag(EXCEPTIONS /EHsc)
|
||||||
dolphin_compile_definitions(_DEBUG DEBUG_ONLY)
|
dolphin_compile_definitions(_DEBUG DEBUG_ONLY)
|
||||||
|
|
||||||
|
# Enforce C++ standard conforming conversion rules to catch possible bugs
|
||||||
|
add_compile_options(/permissive-)
|
||||||
|
# Remove unreferenced inline functions/data to reduce link time and catch bugs
|
||||||
|
add_compile_options(/Zc:inline)
|
||||||
|
# Assume `new` (w/o std::nothrow) throws to reduce binary size
|
||||||
|
add_compile_options(/Zc:throwingNew)
|
||||||
|
# Enforce strict volatile semantics as per ISO C++
|
||||||
|
add_compile_options(/volatile:iso)
|
||||||
|
|
||||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " /NXCOMPAT")
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " /NXCOMPAT")
|
||||||
else()
|
else()
|
||||||
add_definitions(-D_DEFAULT_SOURCE)
|
add_definitions(-D_DEFAULT_SOURCE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user