How to statically link against an external dependency? #13370
Unanswered
PlayerLegend
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Meson 0.61.2 on Linux and am attempting to cross compile to Windows. I would like to statically link my executable against SDL2. So far, I have seen a bunch of answers saying that adding
default_options: ['default_library=static']
to the project() function will do it, but this has not worked for me.Currently, my project has a subproject which is an SDL2 wrapper library, and another subproject that contains the executable I'm trying to build. This executable depends on the wrapper library, which then depends on SDL2. I have added
default_options: ['default_library=static']
to the parent project and both subprojects.I have also tried adding
default_options: ['default_library=static']
to the dependency() call for SDL2, as well as running setup with--default-library=static
. In each case, the result has been an executable that depends onSDL2.dll
.Is this a bug, or have I misunderstood something?
Beta Was this translation helpful? Give feedback.
All reactions