Fix warnings as errors for MSVC

This commit is contained in:
Dale Glass 2024-03-16 00:40:33 +01:00
parent 3d5afbdd31
commit 40761fb545

View file

@ -184,8 +184,13 @@ if(OVERTE_WARNINGS_WHITELIST)
endif()
if(OVERTE_WARNINGS_AS_ERRORS)
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -Werror")
set(ENV{CFLAGS} "$ENV{CXXFLAGS} -Werror")
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR (CMAKE_CXX_COMPILER_ID MATCHES "" AND WIN32))
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} /WX")
set(ENV{CFLAGS} "$ENV{CXXFLAGS} /WX")
else()
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -Werror")
set(ENV{CFLAGS} "$ENV{CXXFLAGS} -Werror")
endif()
endif()