Skip to content

Allow static linking on Windows #29

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 2 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libxml++/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ endforeach
xmlxx_cpp_args = [ '-DLIBXMLPP_BUILD=1' ]

# Make sure we are exporting the symbols from the DLL
if is_msvc
if is_msvc and get_option('default_library') != 'static'
xmlxx_cpp_args += ['-D_WINDLL']
endif

Expand Down
2 changes: 2 additions & 0 deletions libxml++config.h.meson
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
/* Micro version number of libxml++. */
#mesondefine LIBXMLXX_MICRO_VERSION

#mesondefine LIBXMLXX_STATIC

// Enable DLL-specific stuff only when not building a static library
#if !defined(__CYGWIN__) && (defined(__MINGW32__) || defined(_MSC_VER)) && !defined(LIBXMLXX_STATIC)
# define LIBXMLPP_DLL 1
Expand Down
6 changes: 4 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,12 @@ endif

# Static library?
library_build_type = get_option('default_library')
pkg_conf_data.set('LIBXMLXX_STATIC', library_build_type == 'static')


if cpp_compiler.get_argument_syntax() == 'msvc'
if library_build_type == 'static' or library_build_type == 'both'
error('Static builds are not supported by MSVC-style builds')
if library_build_type == 'both'
error('Dynamic+Static builds are not supported by MSVC-style builds')
endif
endif

Expand Down