Skip to content

Commit bdfcd22

Browse files
feat: export CGO_{C,CPP,CXX,LD}FLAGS from un-prefixed counterparts (#68)
1 parent ec0f29f commit bdfcd22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

proc/12-arch-flags.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ ab_arch_setflags() {
8888
export "${flagtype}"="${_tmp[*]}"
8989
abdbg "${flagtype}=${_tmp[*]}"
9090

91+
# export CGO counterparts for CFLAGS, CPPFLAGS, CXXFLAGS, and LDFLAGS.
92+
# see <https://go.dev/src/cmd/cgo/doc.go>.
93+
case "${flagtype}" in
94+
CFLAGS|CPPFLAGS|CXXFLAGS|LDFLAGS)
95+
export "CGO_${flagtype}"="${_tmp[*]}"
96+
abdbg "CGO_${flagtype}=${_tmp[*]}"
97+
;;
98+
esac
99+
91100
# Do the same thing if HWCAPS is enabled
92101
if bool "$hwcaps_active" ; then
93102
for cap in "${hwcaps[@]}" ; do

0 commit comments

Comments
 (0)