Remove CompileOptionsOverride

These overrides existed to prevent MSVC errors related to duplicate
compiler warnings. Because we required a version of CMake older
3.15, CMake would add /W3 as a default compiler flag when using
MSVC. We then add /W4 in addition to that. Modern CMake versions
seem to deduplicate these warnings but older versions did not.

The easist fix is to raise the minimum CMake version to 3.15 which
changes the default behavior to no longer add /W3 without being
explicitly specified. See the below link for more information about
this behavior change.

https://cmake.org/cmake/help/latest/policy/CMP0092.html
This commit is contained in:
Chris Thrasher 2022-03-04 21:08:56 -07:00 committed by Lukas Dürrenberger
parent 829cf3b502
commit 3301c47755
2 changed files with 1 additions and 9 deletions

View File

@ -1,7 +1,4 @@
cmake_minimum_required(VERSION 3.8)
# customize the compiler options CMake uses to initialize variables with
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/CompilerOptionsOverride.cmake")
cmake_minimum_required(VERSION 3.15)
# define a macro that helps defining an option
macro(sfml_set_option var default type docstring)

View File

@ -1,5 +0,0 @@
if(MSVC)
# remove default warning level from CMAKE_CXX_FLAGS_INIT
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT}")
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT}")
endif()