]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
ci: default to -O2
authorSam James <sam@gentoo.org>
Wed, 10 Apr 2024 14:41:08 +0000 (15:41 +0100)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 10 Apr 2024 21:15:35 +0000 (00:15 +0300)
We need this for when we're passing sanitizer flags or -gdwarf-4 for Clang
with Valgrind. Just always start with -O2 if CFLAGS isn't set in the
environment and append what was passed on the command line.

build-aux/ci_build.sh

index e92d88c981a22b8aaf6079a123dbbb819436c02b..da780f3309607ecfe9599907982c2455a524bbb2 100755 (executable)
@@ -48,6 +48,7 @@ DEST_DIR="$SRC_DIR/../xz_build"
 PHASE="all"
 ARTIFACTS_DIR_NAME="output"
 
+[[ -z ${CFLAGS} ]] && export CFLAGS="-O2"
 
 ###################
 # Parse arguments #
@@ -105,7 +106,7 @@ while getopts a:b:c:d:l:m:n:s:p:f:w:h opt; do
        p) PHASE="$OPTARG"
        ;;
        f)
-               CFLAGS="$OPTARG"
+               CFLAGS+=" $OPTARG"
                export CFLAGS
        ;;
        w) WRAPPER="$OPTARG"