From 89f7bcac086e0134f01cc94ed770d67ff2f44bc5 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 29 Sep 2020 14:04:30 +0800 Subject: [PATCH] meson: Don't use .def files for Visual Studio builds Instead, when building with Visual Studio-style compilers, define 'FcPublic' as appropriate so that symbols will be exported without the need to maintain a .def file. --- src/meson.build | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/meson.build b/src/meson.build index 5af3818..f2a4861 100644 --- a/src/meson.build +++ b/src/meson.build @@ -57,17 +57,18 @@ fcobjshash_h = custom_target('fcobjshash.h', command: [gperf, '--pic', '-m', '100', '@INPUT@', '--output-file', '@OUTPUT@'] ) -# write def file with exports for windows -cdata_def = configuration_data() -cdata_def.set('DEF_VERSION', defversion) -fontconfig_def = configure_file(input: 'fontconfig.def.in', output: 'fontconfig.def', configuration: cdata_def) +# Define FcPublic appropriately for exports on windows +fc_extra_c_args = [] + +if cc.get_argument_syntax() == 'msvc' + fc_extra_c_args += '-DFcPublic=__declspec(dllexport)' +endif libfontconfig = library('fontconfig', fc_sources, alias_headers, ft_alias_headers, fclang_h, fccase_h, fcobjshash_h, - c_args: c_args, + c_args: c_args + fc_extra_c_args, include_directories: incbase, dependencies: deps, - vs_module_defs: fontconfig_def, install: true, soversion: soversion, version: libversion,