-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/mobile: gomobile bind can't use target specific LDFLAGS / CPPFLAGS #48203
Comments
I tried with this: // #cgo android,amd64 LDFLAGS: -L${SRCDIR}/../dependencies/libs/x86_64 -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_gapi -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_video -lopencv_videoio But it doesn't work, as this is project which is external dependency, I can't change their files. Changing in my files which imports packages from that project doesn't work. |
I would be happy to do a PR. My idea is the following: Implement CGO_LDFLAGS_%GOOS_%ARCH with fallback to CGO_LDFLAGS. Examples:
|
/cc @hyangah |
you can use LDFLAGS
and if you use go mod add this line in go.mod
|
Hey, thank you for the efforts. I am perfectly aware of compiler directives such as #cgo ... |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am trying to build .aar archive with gomobile bind but with CGO_LDFLAGS and CGO_CPPFLAGS which are TARGET dependant.
I can build for loop, to create 4 .aar files and to manually combine them at the end, but I think there should be smarter way.
What did you expect to see?
AAR file with compiled .so libraries without issues.
What did you see instead?
The text was updated successfully, but these errors were encountered: