-
Notifications
You must be signed in to change notification settings - Fork 73
Support static builds for Visual Studio #91
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
Conversation
Hi, For records:
With blessings, and cheers! |
We need different defines/cflags for building static and shared builds of libsigc++, so we can't really support default_library = 'both' for libsigc++ without much retinkering. So, just disallow such builds at least for now. Also, save up whether we are attempting a static build in the Visual Studio build.
...and add a new check macro LIBSIGCXX_STATIC, to use the appropriate macros to build and link against libsigc++. Drop this from the build files as well.
Apply -DLIBSIGCXX_STATIC as appropriate when we request a static build to be done for the Meson and NMake builds, and skip building the version .rc file if a static build is requested. For the NMake builds, separate the build artifacts from the static and shared builds. The CMake builds are not updated here as it always assumes a shared build, nor are the autotools builds since it is not used for Visual Studio builds at all.
Copy the built DLL and PDB only if building a shared build, and copy the appropriate .lib file according to the build type.
Update the Meson build files to put in -DLIBSIGCXX_STATIC when we are building a static build of libsigc++. For the CMake and autotools build, this is not used.
If you still have permission to merge to libsigcplusplus, please do. Can static builds be supported also for libsigc++2 (branch libsigc++-2-12)? |
Hi @kjellahl, Sadly, I don't have the permissions... The PR for libsigc++-2.x is done in #92 (sorry, I forgot to make the title there clearer)-but like you said, the libxml++ don't support static builds due to glibmm, but anyways, for completeness sake I added support for libsigc++-2.x. With blessings, than you! |
Hi,
This attempts to address issue #90 by supporting static builds of libsigc++, where:
LIBSIGXX_STATIC
in the sigc++config.h.* files, to check whether we are going to use a static MSVC build.-Ddefault_library=both
is explicitly not supported). The generated .pc file from static Visual Studio builds will define-DLIBSIGCXX_STATIC
in theCXXFLAGS
-DLIBSIGCXX_STATIC
is required if attempting to build against a static libsigc++ build.Fixes issue #90.
With blessings, thank you!