From 8ca167ee93d4a79f1f24bd959de8b85183577064 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 28 Aug 2024 17:13:54 -0400 Subject: build: Move per-file flag support into cc.sh --- build/flags-if.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'build/flags-if.sh') diff --git a/build/flags-if.sh b/build/flags-if.sh index 76e1c34..81eb345 100755 --- a/build/flags-if.sh +++ b/build/flags-if.sh @@ -7,11 +7,15 @@ set -eu +build/cc.sh "$@" || exit 1 + +# If the build succeeded, print any lines like +# +# /// _CFLAGS += -foo +# +# (unless they're already set) OLD_FLAGS="$XCC $XCPPFLAGS $XCFLAGS $XLDFLAGS $XLDLIBS" -NEW_FLAGS=$(sed -n '\|^///|{s|^/// ||; s|[^=]*= ||; p;}' "$1") -build/cc.sh "$@" $NEW_FLAGS || exit 1 -# De-duplicate against the existing flags while IFS="" read -r line; do case "$line" in ///*=*) -- cgit v1.2.3