Skip to content

Commit b0312f2

Browse files
fanc999-1kjellahl
authored andcommitted
meson: Disallow default_library == 'both' on Visual Studio
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.
1 parent bc91a4f commit b0312f2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

meson.build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ cpp_compiler = meson.get_compiler('cpp')
4343
is_msvc = cpp_compiler.get_id() == 'msvc'
4444
python3 = find_program('python3', version: '>=3.5')
4545

46+
# MSVC: We currently do not support shared and static builds at the,
47+
# same time, since we need different defines/cflags for proper
48+
# linking.
49+
if is_msvc
50+
if get_option('default_library') == 'both'
51+
error('-Ddefault_library=both is currently not supported for Visual Studio')
52+
endif
53+
is_msvc_static = get_option('default_library') == 'static'
54+
else
55+
is_msvc_static = false
56+
endif
57+
4658
# Do we build from a git repository?
4759
# Suppose we do if and only if the meson.build file is tracked by git.
4860
cmd_py = '''

0 commit comments

Comments
 (0)