meson: Don't apply -DHB_DLL_EXPORT to all targets
Only have it apply to the libraries when they are not built statically on Visual Studio
This commit is contained in:
parent
a224f4179f
commit
3341d5346e
|
@ -33,7 +33,6 @@ if cpp.get_id() == 'msvc'
|
||||||
'/wd4244', # lossy type conversion (e.g. double -> int)
|
'/wd4244', # lossy type conversion (e.g. double -> int)
|
||||||
'/wd4305', # truncating type conversion (e.g. double -> float)
|
'/wd4305', # truncating type conversion (e.g. double -> float)
|
||||||
cpp.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
cpp.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
||||||
'-DHB_DLL_EXPORT', # FIXME: shouldn't this be set only on the lib targets?
|
|
||||||
]
|
]
|
||||||
add_project_arguments(msvc_args, language : 'c')
|
add_project_arguments(msvc_args, language : 'c')
|
||||||
add_project_arguments(msvc_args, language : 'cpp')
|
add_project_arguments(msvc_args, language : 'cpp')
|
||||||
|
|
|
@ -214,10 +214,15 @@ harfbuzz_def = custom_target('harfbuzz.def',
|
||||||
|
|
||||||
version = '0.' + '0'.join(meson.project_version().split('.')) + '.0'
|
version = '0.' + '0'.join(meson.project_version().split('.')) + '.0'
|
||||||
|
|
||||||
|
extra_hb_cpp_args = []
|
||||||
|
if get_option('default_library') == 'shared' and cpp.get_id() == 'msvc'
|
||||||
|
extra_hb_cpp_args += '-DHB_DLL_EXPORT'
|
||||||
|
endif
|
||||||
|
|
||||||
libharfbuzz = library('harfbuzz', hb_sources,
|
libharfbuzz = library('harfbuzz', hb_sources,
|
||||||
include_directories: [incconfig, incucdn],
|
include_directories: [incconfig, incucdn],
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
cpp_args: cpp_args,
|
cpp_args: cpp_args + extra_hb_cpp_args,
|
||||||
vs_module_defs: harfbuzz_def,
|
vs_module_defs: harfbuzz_def,
|
||||||
soversion: '0',
|
soversion: '0',
|
||||||
version: version,
|
version: version,
|
||||||
|
@ -238,7 +243,7 @@ harfbuzz_subset_def = custom_target('harfbuzz-subset.def',
|
||||||
libharfbuzz_subset = library('harfbuzz-subset', hb_subset_sources,
|
libharfbuzz_subset = library('harfbuzz-subset', hb_subset_sources,
|
||||||
include_directories: incconfig,
|
include_directories: incconfig,
|
||||||
link_with: [libharfbuzz],
|
link_with: [libharfbuzz],
|
||||||
cpp_args: cpp_args,
|
cpp_args: cpp_args + extra_hb_cpp_args,
|
||||||
vs_module_defs: harfbuzz_subset_def,
|
vs_module_defs: harfbuzz_subset_def,
|
||||||
soversion: '0',
|
soversion: '0',
|
||||||
version: version,
|
version: version,
|
||||||
|
@ -322,7 +327,7 @@ if have_gobject
|
||||||
include_directories: incconfig,
|
include_directories: incconfig,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
link_with: [libharfbuzz],
|
link_with: [libharfbuzz],
|
||||||
cpp_args: cpp_args,
|
cpp_args: cpp_args + extra_hb_cpp_args,
|
||||||
vs_module_defs: harfbuzz_gobject_def,
|
vs_module_defs: harfbuzz_gobject_def,
|
||||||
soversion: '0',
|
soversion: '0',
|
||||||
version: version,
|
version: version,
|
||||||
|
|
Loading…
Reference in New Issue