Open happyalu opened 1 year ago
Hi happyalu,
Can you please add more details to the bug and use the bug format. If this is not a bug, please see below.
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
For asking questions, see:
The official Q&A channel for Google's Go Programming Language on Stack Overflow
Stack Overflow with questions tagged "go" or "golang" (complementing the Go Collective mentioned before)
The Go Forum, a web-based forum
Gophers Slack, use the invite app for access. The #general channel is a good starting point.
Go Community on Hashnode with questions and posts tagged with "go"
IRC channel #go-nuts on Libera
Sorry, I was not aware of the bug template. Updated my post above with more details.
@hyangah can you give this a look?
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.