ci: default to -O2

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.
This commit is contained in:
Sam James 2024-04-10 15:41:08 +01:00 committed by Lasse Collin
parent bc899f9e07
commit 65bf7e0a1c
1 changed files with 2 additions and 1 deletions

View File

@ -48,6 +48,7 @@ DEST_DIR="$SRC_DIR/../xz_build"
PHASE="all" PHASE="all"
ARTIFACTS_DIR_NAME="output" ARTIFACTS_DIR_NAME="output"
[[ -z ${CFLAGS} ]] && export CFLAGS="-O2"
################### ###################
# Parse arguments # # 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" p) PHASE="$OPTARG"
;; ;;
f) f)
CFLAGS="$OPTARG" CFLAGS+=" $OPTARG"
export CFLAGS export CFLAGS
;; ;;
w) WRAPPER="$OPTARG" w) WRAPPER="$OPTARG"