Remove warnings-as-errors by default
Compiling C++ on various different platforms with as many out of tree dependencies as we have is volatile at best. In order to prevent a third party warning from ruining the build for people who don't care about third party warnings, we remove warnings-as-errors by default. They are still enabled by default on CI.
This commit is contained in:
committed by
username223
parent
44a5d3eed0
commit
5a7fe687d8
@@ -1,15 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
QMAKE_SPEC='linux-g++'
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
PROJECT_DIR=$SCRIPT_DIR/../../
|
||||
BUILD_DIR=$PROJECT_DIR/build/
|
||||
. $SCRIPT_DIR/configure.sh
|
||||
|
||||
if [[ -z $USE_TIDY ]]; then
|
||||
MAKE_COMMAND="make --jobs ${MAKE_JOBS}"
|
||||
CLANG_TIDY=
|
||||
else
|
||||
# Bear replaces the compile database, it does not update it.
|
||||
# If you run 'bear make' and there is nothing to compile, you
|
||||
# will get an empty database.
|
||||
# Clean up the artifacts and run everything together in that case.
|
||||
MAKE_COMMAND='bear make --jobs'
|
||||
QMAKE_SPEC='linux-clang'
|
||||
CLANG_TIDY="$SCRIPT_DIR/run-clang-tidy.sh"
|
||||
fi
|
||||
|
||||
echo $MAKE_COMMAND
|
||||
mkdir -p $BUILD_DIR
|
||||
cd $BUILD_DIR
|
||||
qmake --version
|
||||
qmake -spec $QMAKE_SPEC $PROJECT_DIR $QMAKE_EXTRAS
|
||||
qmake -spec $QMAKE_SPEC $PROJECT_DIR CONFIG+=warnings_as_errors
|
||||
$MAKE_COMMAND
|
||||
$CLANG_TIDY
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [[ -z $QMAKE_SPEC ]]; then
|
||||
QMAKE_SPEC='linux-g++'
|
||||
fi
|
||||
|
||||
if [[ -z $USE_TIDY ]]; then
|
||||
MAKE_COMMAND="make --jobs ${MAKE_JOBS}"
|
||||
CLANG_TIDY=
|
||||
else
|
||||
# Bear replaces the compile database, it does not update it.
|
||||
# If you run 'bear make' and there is nothing to compile, you
|
||||
# will get an empty database.
|
||||
# Clean up the artifacts and run everything together in that case.
|
||||
MAKE_COMMAND='bear make --jobs'
|
||||
QMAKE_SPEC='linux-clang'
|
||||
CLANG_TIDY="$SCRIPT_DIR/run-clang-tidy.sh"
|
||||
fi
|
||||
|
||||
if [[ -n $NO_X11 ]]; then
|
||||
QMAKE_EXTRAS='CONFIG+=noX11'
|
||||
fi
|
||||
if [[ -n $NO_DBUS ]]; then
|
||||
QMAKE_EXTRAS='CONFIG+=noDBUS'
|
||||
fi
|
||||
@@ -48,7 +48,10 @@ QMAKE_CXXFLAGS += -Wmost
|
||||
|
||||
QMAKE_CXXFLAGS += -Wpedantic
|
||||
|
||||
QMAKE_CXXFLAGS += -Werror
|
||||
warnings_as_errors {
|
||||
QMAKE_CXXFLAGS += -Werror
|
||||
}
|
||||
|
||||
#All includes from the third-party directory will not warn.
|
||||
QMAKE_CXXFLAGS += --system-header-prefix=third-party
|
||||
QMAKE_CXXFLAGS += --system-header-prefix=qt
|
||||
|
||||
@@ -27,7 +27,9 @@ include(clang-gcc-common-switches.pri)
|
||||
|
||||
QMAKE_CXXFLAGS += -Wpedantic
|
||||
|
||||
QMAKE_CXXFLAGS += -Werror
|
||||
warnings_as_errors {
|
||||
QMAKE_CXXFLAGS += -Werror
|
||||
}
|
||||
|
||||
# GCC only switches
|
||||
QMAKE_CXXFLAGS += -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wrestrict -Wnull-dereference
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
include(common-msvc.pri)
|
||||
|
||||
# Warnings as errors
|
||||
QMAKE_CXXFLAGS += /WX
|
||||
warnings_as_errors {
|
||||
# Warnings as errors
|
||||
QMAKE_CXXFLAGS += /WX
|
||||
}
|
||||
|
||||
# Enables Link Time Optimization
|
||||
QMAKE_CXXFLAGS += /GL
|
||||
|
||||
@@ -139,7 +139,10 @@ def build():
|
||||
say(f"{BUILD_DEBUG_VAR_NAME} not defined. Building '{COMPILE_MODE}' version.")
|
||||
|
||||
add_line_to_run_bat_file("@ECHO Running qmake:")
|
||||
add_line_to_run_bat_file('"' + QMAKE_LOC + '"' + " -spec " + COMPILER + " CONFIG+=X86_64 " + "CONFIG+=" + COMPILE_MODE)
|
||||
if is_env_var_set("OVRAS_WARNINGS_AS_ERRORS"):
|
||||
add_line_to_run_bat_file('"' + QMAKE_LOC + '"' + " -spec " + COMPILER + " CONFIG+=X86_64 " + "CONFIG+=" + COMPILE_MODE + " CONFIG+=warnings_as_errors")
|
||||
else:
|
||||
add_line_to_run_bat_file('"' + QMAKE_LOC + '"' + " -spec " + COMPILER + " CONFIG+=X86_64 " + "CONFIG+=" + COMPILE_MODE)
|
||||
add_error_handling_line_to_bat_file()
|
||||
add_line_to_run_bat_file("@ECHO qmake done.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user