What to use for first argument of pkg.generate() when library target has 'name_prefix' set #9746
-
For example, in this PR for the libui project, I've used the library object, but I get the warnings when running ninja
What should I be using for the first argument of pkg.generate()? In the meson.build for that project, the library is declared like this:
The .pc file is output as
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I guess meson isn't (currently?) clever enough to notice that the name_prefix is still the default value on Linux, so it emits the warning anyway. In theory, this could be something meson learns to do... Something that should work either way is: kwargs = {}
if host_machine.system() == 'windows'
kwargs = {'name_prefix': 'lib'} # always call it libui, even in Windows DLLs
endif
libui_libui = library('ui', libui_sources,
dependencies: libui_deps,
build_rpath: libui_rpath,
install_rpath: libui_rpath,
install: true,
gnu_symbol_visibility: 'hidden',
c_args: ['-Dlibui_EXPORTS'],
cpp_args: ['-Dlibui_EXPORTS'],
objc_args: ['-Dlibui_EXPORTS'],
link_args: libui_libui_link_args,
soversion: libui_soversion,
darwin_versions: [], # TODO
kwargs: kwargs) Those kwargs will only fill out the name_prefix value on Windows, and I guess only warn on Windows. What does Windows do when GCC or clang see |
Beta Was this translation helpful? Give feedback.
I guess meson isn't (currently?) clever enough to notice that the name_prefix is still the default value on Linux, so it emits the warning anyway. In theory, this could be something meson learns to do...
Something that should work either way is: