Enable warnings as errors in MSVC builds.

LTO-timing^2
Project579 3 years ago
parent bf17dc55e5
commit 5ee825b5f6

@ -84,7 +84,7 @@ Coverity:
CXX: clang++
CXXFLAGS: -O0
artifacts:
paths:
paths:
- /builds/OpenMW/openmw/cov-int/build-log.txt
Ubuntu_GCC:
@ -478,7 +478,7 @@ macOS12_Xcode13:
- $env:CCACHE_BASEDIR = Get-Location
- $env:CCACHE_DIR = "$(Get-Location)\ccache"
- New-Item -Type Directory -Force -Path $env:CCACHE_DIR
- sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -b -t -C $multiview
- sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -b -t -C $multiview -E
- cd MSVC2019_64
- cmake --build . --config $config
- ccache --show-stats

@ -76,6 +76,8 @@ GOOGLE_INSTALL_ROOT=""
INSTALL_PREFIX="."
BUILD_BENCHMARKS=""
OSG_MULTIVIEW_BUILD=""
USE_WERROR=""
USE_CLANG_TIDY=""
ACTIVATE_MSVC=""
SINGLE_CONFIG=""
@ -116,7 +118,7 @@ while [ $# -gt 0 ]; do
n )
NMAKE=true ;;
N )
NINJA=true ;;
@ -140,10 +142,16 @@ while [ $# -gt 0 ]; do
b )
BUILD_BENCHMARKS=true ;;
M )
OSG_MULTIVIEW_BUILD=true ;;
M )
OSG_MULTIVIEW_BUILD=true ;;
E )
USE_WERROR=true ;;
T )
USE_CLANG_TIDY=true ;;
h )
cat <<EOF
Usage: $0 [-cdehkpuvVi]
@ -182,8 +190,12 @@ Options:
CMake install prefix
-b
Build benchmarks
-M
Use a multiview build of OSG
-M
Use a multiview build of OSG
-E
Use warnings as errors (/WX)
-T
Run clang-tidy
EOF
wrappedExit 0
;;
@ -518,6 +530,14 @@ if ! [ -z $USE_CCACHE ]; then
add_cmake_opts "-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
fi
if ! [ -z "$USE_WERROR" ]; then
add_cmake_opts "-DOPENMW_MSVC_WERROR=ON"
fi
if ! [ -z "$USE_CLANG_TIDY" ]; then
add_cmake_opts "-DCMAKE_CXX_CLANG_TIDY=\"clang-tidy --warnings-as-errors=*\""
fi
ICU_VER="70_1"
OSG_ARCHIVE_NAME="OSGoS 3.6.5"

@ -690,7 +690,7 @@ if (WIN32)
# Play a bit with the warning levels
set(WARNINGS "/W4")
set(WARNINGS /W4)
set(WARNINGS_DISABLE
4100 # Unreferenced formal parameter (-Wunused-parameter)
@ -712,9 +712,13 @@ if (WIN32)
endif()
foreach(d ${WARNINGS_DISABLE})
set(WARNINGS "${WARNINGS} /wd${d}")
list(APPEND WARNINGS /wd${d})
endforeach(d)
if(OPENMW_MSVC_WERROR)
list(APPEND WARNINGS /WX)
endif()
set_target_properties(components PROPERTIES COMPILE_FLAGS "${WARNINGS}")
set_target_properties(osg-ffmpeg-videoplayer PROPERTIES COMPILE_FLAGS "${WARNINGS}")

Loading…
Cancel
Save