summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9aea4af87..04018233f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,15 +21,29 @@ if (MSVC)
21 # Ensure that projects build with Unicode support. 21 # Ensure that projects build with Unicode support.
22 add_definitions(-DUNICODE -D_UNICODE) 22 add_definitions(-DUNICODE -D_UNICODE)
23 23
24 # /W3 - Level 3 warnings 24 # /W3 - Level 3 warnings
25 # /MP - Multi-threaded compilation 25 # /MP - Multi-threaded compilation
26 # /Zi - Output debugging information 26 # /Zi - Output debugging information
27 # /Zo - enhanced debug info for optimized builds 27 # /Zo - Enhanced debug info for optimized builds
28 # /permissive- - enables stricter C++ standards conformance checks 28 # /permissive- - Enables stricter C++ standards conformance checks
29 # /EHsc - C++-only exception handling semantics 29 # /EHsc - C++-only exception handling semantics
30 # /Zc:throwingNew - let codegen assume `operator new` will never return null 30 # /volatile:iso - Use strict standards-compliant volatile semantics.
31 # /Zc:inline - let codegen omit inline functions in object files 31 # /Zc:externConstexpr - Allow extern constexpr variables to have external linkage, like the standard mandates
32 add_compile_options(/W3 /MP /Zi /Zo /permissive- /EHsc /std:c++latest /Zc:throwingNew,inline) 32 # /Zc:inline - Let codegen omit inline functions in object files
33 # /Zc:throwingNew - Let codegen assume `operator new` (without std::nothrow) will never return null
34 add_compile_options(
35 /W3
36 /MP
37 /Zi
38 /Zo
39 /permissive-
40 /EHsc
41 /std:c++latest
42 /volatile:iso
43 /Zc:externConstexpr
44 /Zc:inline
45 /Zc:throwingNew
46 )
33 47
34 # /GS- - No stack buffer overflow checks 48 # /GS- - No stack buffer overflow checks
35 add_compile_options("$<$<CONFIG:Release>:/GS->") 49 add_compile_options("$<$<CONFIG:Release>:/GS->")
@@ -37,7 +51,10 @@ if (MSVC)
37 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /MANIFEST:NO" CACHE STRING "" FORCE) 51 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /MANIFEST:NO" CACHE STRING "" FORCE)
38 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE) 52 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE)
39else() 53else()
40 add_compile_options("-Wno-attributes") 54 add_compile_options(
55 -Wall
56 -Wno-attributes
57 )
41 58
42 if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) 59 if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
43 add_compile_options("-stdlib=libc++") 60 add_compile_options("-stdlib=libc++")