mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-15 12:07:42 +00:00
maint(linux): add --no-werror option to not report warnings as errors
By default we add the `--werror` option to meson builds. This might cause problems when compiling with a different compiler, so this option adds the `--no-werror` option to our build scripts. This enables integrators to compile with other compiler versions. Fixes: #13970 Cherry-pick-of: #13988 Test-bot: skip
This commit is contained in:
parent
bf35186a72
commit
fdd1e79a45
5 changed files with 26 additions and 7 deletions
|
|
@ -69,7 +69,8 @@ Libraries will be built in 'build/<target>/<configuration>/src'.
|
|||
"uninstall uninstall libraries from current system" \
|
||||
"${archtargets[@]}" \
|
||||
"--no-tests do not configure tests (used by other projects)" \
|
||||
"--test,-t=opt_tests test[s] to run (space separated)"
|
||||
"--test,-t=opt_tests test[s] to run (space separated)" \
|
||||
"--no-werror don't report warnings as errors"
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -115,6 +116,11 @@ builder_describe_outputs \
|
|||
build:arch /core/build/arch/$BUILDER_CONFIGURATION/src/libkeymancore.a \
|
||||
build:wasm /core/build/wasm/$BUILDER_CONFIGURATION/src/libkeymancore.a
|
||||
|
||||
MESON_ARGS=--werror
|
||||
if builder_has_option --no-werror; then
|
||||
MESON_ARGS=
|
||||
fi
|
||||
|
||||
# Import our standard compiler defines; this is copied from
|
||||
# /resources/build/meson/standard.meson.build by build.sh, because meson doesn't
|
||||
# allow us to reference a file outside its root
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ do_configure() {
|
|||
else
|
||||
pushd "$THIS_SCRIPT_PATH" > /dev/null
|
||||
# Additional arguments are used by Linux build, e.g. -Dprefix=${INSTALLDIR}
|
||||
meson setup "$MESON_PATH" $MESON_CROSS_FILE --werror --buildtype $BUILDER_CONFIGURATION $STANDARD_MESON_ARGS "${builder_extra_params[@]}"
|
||||
meson setup "$MESON_PATH" $MESON_CROSS_FILE ${MESON_ARGS} --buildtype $BUILDER_CONFIGURATION $STANDARD_MESON_ARGS "${builder_extra_params[@]}"
|
||||
popd > /dev/null
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ builder_describe \
|
|||
"--no-integration+ don't run integration tests" \
|
||||
"--coverage+ capture test coverage" \
|
||||
"--report+ create coverage report" \
|
||||
"--open open the coverage reports in the browser"
|
||||
"--open open the coverage reports in the browser" \
|
||||
"--no-werror+ don't report warnings as errors"
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ builder_describe \
|
|||
"@../keyman-system-service:service" \
|
||||
"--no-integration don't run integration tests" \
|
||||
"--report create coverage report" \
|
||||
"--coverage capture test coverage"
|
||||
"--coverage capture test coverage" \
|
||||
"--no-werror don't report warnings as errors"
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -45,6 +46,11 @@ else
|
|||
MESON_COVERAGE=
|
||||
fi
|
||||
|
||||
MESON_ARGS=--werror
|
||||
if builder_has_option --no-werror; then
|
||||
MESON_ARGS=
|
||||
fi
|
||||
|
||||
# Import our standard compiler defines; this is copied from
|
||||
# /resources/build/meson/standard.meson.build by build.sh, because meson doesn't
|
||||
# allow us to reference a file outside its root. ${THIS_SCRIPT_PATH}/meson.build
|
||||
|
|
@ -56,7 +62,7 @@ fi
|
|||
|
||||
configure_action() {
|
||||
# shellcheck disable=SC2086,SC2154
|
||||
meson setup ${MESON_COVERAGE} --werror --buildtype $MESON_TARGET "${builder_extra_params[@]}" "$MESON_PATH"
|
||||
meson setup ${MESON_COVERAGE} ${MESON_ARGS} --buildtype $MESON_TARGET "${builder_extra_params[@]}" "$MESON_PATH"
|
||||
}
|
||||
|
||||
test_action() {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ builder_describe \
|
|||
"uninstall uninstall artifacts" \
|
||||
"--no-integration don't run integration tests" \
|
||||
"--report create coverage report" \
|
||||
"--coverage capture test coverage"
|
||||
"--coverage capture test coverage" \
|
||||
"--no-werror don't report warnings as errors"
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -42,6 +43,11 @@ else
|
|||
fi
|
||||
MESON_PATH="build/$(uname -m)/$MESON_TARGET"
|
||||
|
||||
MESON_ARGS=--werror
|
||||
if builder_has_option --no-werror; then
|
||||
MESON_ARGS=
|
||||
fi
|
||||
|
||||
clean_action() {
|
||||
rm -rf "$THIS_SCRIPT_PATH/build/"
|
||||
}
|
||||
|
|
@ -61,7 +67,7 @@ check_missing_coverage_configuration() {
|
|||
|
||||
configure_action() {
|
||||
# shellcheck disable=SC2086,SC2154,SC2248
|
||||
meson setup ${MESON_COVERAGE} --werror --buildtype ${MESON_TARGET} "${builder_extra_params[@]}" "${MESON_PATH}"
|
||||
meson setup ${MESON_COVERAGE} ${MESON_ARGS} --buildtype ${MESON_TARGET} "${builder_extra_params[@]}" "${MESON_PATH}"
|
||||
}
|
||||
|
||||
test_action() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue