Replies: 2 comments 1 reply
-
This isn't something Meson is doing. The That option also says to statically link to the platform C standard library (e.g. glibc). What's your goal here? If you just want to link some of your dependencies statically, but you don't want to build a "fully static" executable, don't use the You're also manually using This allows you to pass the Meanwhile |
Beta Was this translation helpful? Give feedback.
-
Tested and yes that seems to work! project('foo', 'cpp') project_sources = [] exe=executable( 'foo', |
Beta Was this translation helpful? Give feedback.
-
Following failed on '-lshared-lib' because it is a shared lib only.
The rest ( '-lcrypto', '-lssl') is okay because they exist as static and shared libs.
On meson 0.59 how do I mix shared and static libs?
'-static' makes it static.
project('foo', 'cpp')
project_sources = []
project_includes = [ include_directories('include/','src/') ]
project_c_args = [ '-ffunction-sections', '-fPIC' ]
project_link_args = ['-static', '-Wl,-gc-sections' , '-lshared-lib', '-lcrypto', '-lssl' ]
subdir('src')
exe=executable( 'foo',
project_sources,
include_directories : [ project_includes ],
c_args : project_c_args,
link_args : project_link_args,
)
Beta Was this translation helpful? Give feedback.
All reactions