Skip to content

Commit 21b8da5

Browse files
committed
ci: use CPPFLAGS instead of CFLAGS for macOS include paths
Git's Makefile sets CFLAGS = -g -O2 -Wall which overrides the env var. CPPFLAGS is preserved via ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS), so keg-only Homebrew include paths (gettext, openssl, etc.) are actually picked up by the compiler.
1 parent 3069942 commit 21b8da5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ jobs:
6767
# not linked into the default search paths. Git's config.mak.uname
6868
# gained Homebrew auto-detection for gettext around v2.47, but older
6969
# versions in our matrix (2.34.1, 2.39.5) lack it and fail with
70-
# 'libintl.h' not found. Explicit CFLAGS/LDFLAGS ensure all versions
71-
# build consistently. See: git INSTALL docs, config.mak.uname.
70+
# 'libintl.h' not found. We use CPPFLAGS/LDFLAGS (not CFLAGS) because
71+
# git's Makefile overrides CFLAGS but preserves CPPFLAGS via
72+
# ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS).
7273
if [ "$RUNNER_OS" = "macOS" ]; then
7374
BREW_PREFIX=$(brew --prefix)
74-
export CFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include"
75+
export CPPFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include"
7576
export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib -L${BREW_PREFIX}/opt/gettext/lib"
7677
fi
7778

0 commit comments

Comments
 (0)