x/mobile: CGO_CXXFLAGS, CGO_LDFLAGS overwritten for ios #56137
Labels
mobile
Android, iOS, and x/mobile
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This bug is in cmd/gomobile, and is reproducible with the latest commit on that.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was trying to build an ios framework with gomobile that also includes C dependencies. I need to set CGO_CXXFLAGS and CGO_LDFLAGS to get the build working.
What did you expect to see?
gomobile should forward the values of CGO_CXXFLAGS and CGO_LDFLAGS to rest of the build process (gobind, go build, etc.) This does happen when building for Android, but not when targeting ios.
What did you see instead?
The CGO_CXXFLAGS, CGO_LDFLAGS, etc. variables get overwritten by values that are required to introduce system dependencies for ios.
This was causing my build to break.
Ideally, these new values introduced by gomobile should be appended to values already in the environment. I tried out this change that resolves this issue.
The text was updated successfully, but these errors were encountered: