Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost: Broken detection when cross compiling to Windows hosts #2631

Closed
mia-0 opened this issue Nov 15, 2017 · 8 comments
Closed

Boost: Broken detection when cross compiling to Windows hosts #2631

mia-0 opened this issue Nov 15, 2017 · 8 comments

Comments

@mia-0
Copy link

mia-0 commented Nov 15, 2017

Python system: Linux
Version: 0.43.0

When cross compiling to Windows using a mingw-w64 toolchain, the Boost dependency detection is broken and can’t find the libraries.

Problem is probably right here:

def detect_lib_modules(self):
if mesonlib.is_windows():
return self.detect_lib_modules_win()
return self.detect_lib_modules_nix()

Also, this needs more logging. Can’t even tell what it’s looking for.

@nirbheek
Copy link
Member

@NickeZ, could you look into this and also add more debug logging with mlog.debug()?

@NickeZ
Copy link
Contributor

NickeZ commented Nov 30, 2017

I never tried cross compiling with boost. I probably won't set this up and try it..

@mia-0
Copy link
Author

mia-0 commented Dec 11, 2017 via email

@bredelings
Copy link
Contributor

On Debian a cross build involved installing g++-mingw-w64, wine and wine32. Building the boost dependency so that meson can try to find it might be more work.

Probably most of the occurrences of is_windows() and is_linux() need to be changed to for_windows( ) and for_darwin( ). Specifically,

  • mesonlib.is_windows() -> mesonlib.for_windows(self.want_cross, self.env)
  • mesonlib.is_osx() -> mesonlib.for_darwin(self.want_cross, self.env)

Maybe we should add methods self.for_windows() and self.for_darwin() to ExternalDependency or Dependency?

@lyakhov
Copy link

lyakhov commented Feb 6, 2018

I can confirm the issue exists on Fedora 27 cross-compiling using mingw32 -- and using precompiled boost packages (mingw32-boost, mingw32-boost-static).

Hopefully, there is a workaround, as mentioned at https://unix.stackexchange.com/questions/408963/meson-doesnt-find-the-boost-libraries:

    cxx = meson.get_compiler('cpp')
    boost_dep = [
        cxx.find_library('boost_system'),
        cxx.find_library('ws2_32')
    ]

(that is particular case for boost asio using Windows sockets for TCP)

@bredelings
Copy link
Contributor

See also #2990

@bredelings
Copy link
Contributor

@lachs0r I think this is fixed now in current master. Can you try it out?

@mia-0
Copy link
Author

mia-0 commented Mar 7, 2018

Sorry about the late response. Seems to work now. Thanks!

@mia-0 mia-0 closed this as completed Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants