diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-09-29 14:04:30 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-11-19 11:22:29 +0800 |
commit | 89f7bcac086e0134f01cc94ed770d67ff2f44bc5 (patch) | |
tree | 95503ca97549a98f31481d26440ad4627560e887 | |
parent | b2a54dfb8fe3859cf8c7f1d1d9b43318ef2a0ca3 (diff) |
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.
-rw-r--r-- | src/meson.build | 13 |
1 files 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, |