NordSecurity / uniffi-bindgen-go

Uniffi bindings generator for Golang
Mozilla Public License 2.0
65 stars 18 forks source link

Investigate usage of inlined LDFLAGS #19

Open dignifiedquire opened 9 months ago

dignifiedquire commented 9 months ago

It is possible to include linking instructions in comments, it would be good to investigate if these could be pre-filled in some form, to avoid having to run go commands like this (from the test script)

LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:$BINARIES_DIR" \
CGO_LDFLAGS="-luniffi_fixtures -L$BINARIES_DIR -lm -ldl" \
CGO_ENABLED=1 
dignifiedquire commented 7 months ago

@arg0d any thoughts on this? would you be willing to accept a PR implementing this?

arg0d commented 7 months ago

I guess so, but it should be optional. For our use case we need to link statically.

@Savolro your thoughts?

arg0d commented 7 months ago

Actually, I guess it doesn't matter if linking static/dynamic libraries. The link args will be the same regardless if library is static/dynamic.