summaryrefslogtreecommitdiffstats
path: root/build/flags-if.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build/flags-if.sh')
-rwxr-xr-xbuild/flags-if.sh10
1 files changed, 7 insertions, 3 deletions
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
///*=*)