Skip to content

Meson: More fixes for Windows builds #51

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

Merged
merged 5 commits into from
Dec 29, 2019

Conversation

fanc999
Copy link
Collaborator

@fanc999 fanc999 commented Dec 26, 2019

Hi,

I went a bit further to see whether we can build libsigc++ master in maintainer mode even on Visual Studio builds, and it turns out that it is indeed possible, but it does take some extra steps which involved installing mm-common, doxygen, and GraphViz (GraphViz involves installing a pretty recent mingw-w64).

It seems though, with the above items installed, we still need one small change to meson.build so that things will work, up to and including 'meson dist'.

From the commit message:

Since we are assured that we are using Python 3.x on when we run Meson, we do not really need to look for the 'python3' executable, but we could just use whatever Python interpreter that is used to run Meson.

This will fix situations where it is commonly the case where we may have multiple Python 3.x installations on Windows (www.python.org, and those from Cygwin/mingw-w64), so that Meson really uses one and only one Python installation to run everything that is Python-related, which will
thus fix '[meson|ninja] dist' on Visual Studio builds.

I also managed to re-produce the error that was mentioned in 1, in MSVC_NMake/. Apparently, this is only caused when the build directory is a subdirectory of the source tree, so this attempts to fix this, where it looks like Meson is not handling the path separators properly or so.

Another fix added is to build the .rc files on Windows so that we have the version info embedded in the libsigc++ DLL as we did in the NMake Makefiles (and the previous project files).

With blessings, thank you!

Since we are assured that we are using Python 3.x on when we run Meson, we
do not really need to look for the 'python3' executable, but we could
just use whatever Python interpreter that is used to run Meson.

This will fix situations where it is commonly the case where we may have
multiple Python 3.x installations on Windows (www.python.org, and those
from Cygwin/mingw-w64), so that Meson really uses one and only one
Python installation to run everything that is Python-related, which will
thus fix '[meson|ninja] dist' on Visual Studio builds.
@fanc999 fanc999 changed the title Use python installation used to run Meson consistently (fix 'meson dist' on Windows) Meson: More fixes for Windows builds Dec 26, 2019
It appears that Meson did not construct the paths properly for
shutil.copy2() when building in a build directory that is a
subdirectory of the sources, when using meson.current_build_dir(),
possibly due how path separators are handled.

Fix this by constructing the paths using project_build_root / 'MSVC_NMake'.
This ensures that on Windows, the version info resources are indeed
linked into the libsigc++ DLL.
@fanc999
Copy link
Collaborator Author

fanc999 commented Dec 27, 2019

Hi,

One question though, is the intended library name sigc++-3.0, or is it sigc-3.0 (likewise for the 2.10.x version)? It seems that the original library name (i.e. autotools/NMake...) does not contain '++'...

With blessings, thank you!

This adds the MSVC files in MSVC_NMake/ that are generated during
Meson's configure step to the generated release tarball.

The NMake Makefiles are updated so that they will be able to find files
that are now in untracked/MSVC_NMake, when a release tarball is
generated with Meson.
This makes it less likely for one to accidently mix binaries linked to
different CRTs in a single buildtree.
@kjellahl kjellahl merged commit d37280e into libsigcplusplus:master Dec 29, 2019
kjellahl added a commit that referenced this pull request Dec 29, 2019
Pointed out by Chun-wei Fan in PR #51.
kjellahl added a commit that referenced this pull request Dec 29, 2019
Pointed out by Chun-wei Fan in PR #51.
@kjellahl
Copy link
Contributor

Is the intended library name sigc++-3.0, or is it sigc-3.0?

It's sigc-3.0 and sigc-2.0. I've corrected it. Thanks for noticing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants