Skip to content

Commit 30a701b

Browse files
feat: export CGO_{C,CPP,CXX,LD}FLAGS from un-prefixed counterparts
1 parent ec0f29f commit 30a701b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

proc/12-arch-flags.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ ab_arch_setflags() {
8787
declare -n _tmp="_${flagtype}"
8888
export "${flagtype}"="${_tmp[*]}"
8989
abdbg "${flagtype}=${_tmp[*]}"
90+
# export CGO counterparts for CFLAGS, CPPFLAGS, CXXFLAGS, and LDFLAGS.
91+
# see <https://go.dev/src/cmd/cgo/doc.go>.
92+
case "${flagtype}" in
93+
CFLAGS|CPPFLAGS|CXXFLAGS|LDFLAGS)
94+
export "CGO_${flagtype}"="${_tmp[*]}"
95+
abdbg "CGO_${flagtype}=${_tmp[*]}"
96+
;;
97+
esac
9098

9199
# Do the same thing if HWCAPS is enabled
92100
if bool "$hwcaps_active" ; then

0 commit comments

Comments
 (0)