meson: Boost static detection is broken

detect_lib_modules() calls find_libraries_with_abi_tags() and falls back to self.detect_lib_modules_win() and self.detect_lib_modules_nix() only if the first one fails. find_libraries_with_abi_tag() uses compiler.find_library() and does not respect self.static at all.

Ideally I would expect compiler.find_library() to accept static keyword and just pass it in this call.

Related issue #1709

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 1
  • Comments: 22 (22 by maintainers)

Most upvoted comments

I agree that this seems like the best approach for now. If we could find some way to get the functionality of libfoo.a in a cross-platform way, this would be even better, but I don’t see how to do that yet.

Trying to find library files ourselves seems like we are trying to duplicate the functionality of the compiler inside meson, and this might be fragile. If we use self.links( ) then this will “just work”.

compiler.find_library() does use self.links(), and with linkers that support it, we can tell it to search for static libraries with -l:libfoo.a syntax. However, we always need to search manually because not all linkers support that syntax.