Re: [go-nuts] how to set different flags for different os in cgo

2017-04-19 Thread hui zhang
how ever if I exec > go build -buildmode=c-archive -o libmug.a ./src for mac lib build it build both and failed so does for ios lib , it compile fail > CC=$PWD/clangwrap.sh CXX=$PWD/clangwrap.sh GOOS=darwin GOARCH=arm > CGO_ENABLED=1 go build -buildmode=c-archive -o libmug.a ./src If I co

Re: [go-nuts] how to set different flags for different os in cgo

2017-04-19 Thread Ian Lance Taylor
On Tue, Apr 18, 2017 at 11:00 PM, hui zhang wrote: > I want to set different flags for different os in cgo, how to do that in > cgo? > > >> //#cgo amd64 darwin CFLAGS: -Dxxx >> //#cgo amd64 darwin CXXFLAGS: -Dxxx >> //#cgo amd64 darwin LDFLAGS: -Lxxx >> //#cgo arm darwin CFLAGS: -Dxxx >> //#cgo a