File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ cmake_minimum_required(VERSION 3.15)
6
6
# Enable CMAKE_MSVC_RUNTIME_LIBRARY on Windows: https://cmake.org/cmake/help/latest/policy/CMP0091.html
7
7
cmake_policy (SET CMP0091 NEW )
8
8
9
+ # Do not set default MSVC warning flags: https://cmake.org/cmake/help/latest/policy/CMP0092.html
10
+ cmake_policy (SET CMP0092 NEW )
11
+
9
12
# Default to the last updated version from version.txt.
10
13
file (TO_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/version.txt" VERSION_FILE )
11
14
file (READ "${VERSION_FILE} " LATEST_VERSION )
@@ -52,6 +55,13 @@ if(VCPKG_TARGET_TRIPLET)
52
55
endif ()
53
56
endif ()
54
57
58
+ # Enable more warnings, and treat warnings as errors.
59
+ if (MSVC )
60
+ add_compile_options (/W4 /WX /permissive- )
61
+ else ()
62
+ add_compile_options (-Wall -Wextra -pedantic -Werror )
63
+ endif ()
64
+
55
65
function (add_bigobj_flag target )
56
66
if (MSVC )
57
67
# MSVC requires the /bigobj flag if the number of sections gets too big.
You can’t perform that action at this time.
0 commit comments