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)
66# Enable CMAKE_MSVC_RUNTIME_LIBRARY on Windows: https://cmake.org/cmake/help/latest/policy/CMP0091.html
77cmake_policy (SET CMP0091 NEW)
88
9+ # Do not set default MSVC warning flags: https://cmake.org/cmake/help/latest/policy/CMP0092.html
10+ cmake_policy (SET CMP0092 NEW)
11+
912# Default to the last updated version from version.txt.
1013file (TO_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/version.txt" VERSION_FILE)
1114file (READ "${VERSION_FILE} " LATEST_VERSION)
@@ -52,6 +55,13 @@ if(VCPKG_TARGET_TRIPLET)
5255 endif ()
5356endif ()
5457
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+
5565function (add_bigobj_flag target )
5666 if (MSVC )
5767 # 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