mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-19 03:39:58 +00:00
Enable warnings as errors in MSVC builds.
This commit is contained in:
parent
bf17dc55e5
commit
5ee825b5f6
@ -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=""
|
||||
@ -144,6 +146,12 @@ while [ $# -gt 0 ]; do
|
||||
M )
|
||||
OSG_MULTIVIEW_BUILD=true ;;
|
||||
|
||||
E )
|
||||
USE_WERROR=true ;;
|
||||
|
||||
T )
|
||||
USE_CLANG_TIDY=true ;;
|
||||
|
||||
h )
|
||||
cat <<EOF
|
||||
Usage: $0 [-cdehkpuvVi]
|
||||
@ -184,6 +192,10 @@ Options:
|
||||
Build benchmarks
|
||||
-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…
x
Reference in New Issue
Block a user