gitlab-ci: allow enabling/disabling building documentation in "nm-ci-run.sh"

g-ir-scanner does not support building with clang, due to [1], [2], [3].

It triggers

    checking if /usr/bin/g-ir-scanner works... no (compiler failure -- check config.log)
    configure: error: introspection enabled but can't be used

with

    clang-7: error: unknown argument: '-fstack-clash-protection'

See also commit 99b92fd992, which adds this configure
check.

Honor the environment variable WITH_DOCS to allow the caller to overwrite
the automatic detection that the script does.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=757934
[2] https://gitlab.gnome.org/GNOME/gobject-introspection/issues/150
[3] c14d037228
This commit is contained in:
Thomas Haller 2019-02-05 16:06:02 +01:00
parent 6505a781cf
commit 389197fa81

View file

@ -5,6 +5,7 @@
# - CC
# - BUILD_TYPE
# - CFLAGS
# - WITH_DOCS
set -exv
@ -13,6 +14,20 @@ die() {
exit 1
}
_is_true() {
case "$1" in
1|y|yes|YES|Yes|on)
return 0
;;
0|n|no|NO|No|off)
return 1
;;
*)
die "not a boolean argument \"$1\""
;;
esac
}
###############################################################################
if [ "$BUILD_TYPE" == meson ]; then
@ -45,6 +60,14 @@ if [ "$CC" != gcc ]; then
_WITH_CRYPTO=nss
fi
if [ "$WITH_DOCS" != "" ]; then
if _is_true "$WITH_DOCS"; then
_WITH_DOCS="$_TRUE"
else
_WITH_DOCS="$_FALSE"
fi
fi
###############################################################################
_autotools_test_print_logs() {