diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2018-04-27 17:45:23 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2018-04-28 12:36:00 +0100 |
commit | 5839aeadbdcf08d039eef3a809dc5d78e2c7ba38 (patch) | |
tree | c90540762660535f833d5ba3a6ab93bc312b2fbc /meson.build | |
parent | f77a850077633ee68038bfa2cc7c47a98208df5a (diff) | |
download | orc-5839aeadbdcf08d039eef3a809dc5d78e2c7ba38.tar.gz |
meson: fix symbol export with MSVC and use -fvisibility elsewhere
Use newly-added ORC_API decorators to export symbols explicitly.
Get rid of orc.map file and the ORC_EXPORT stuff that never did
anything anyway (define was unused).
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/meson.build b/meson.build index af4f523..e2c6948 100644 --- a/meson.build +++ b/meson.build @@ -19,6 +19,9 @@ orc_inc = include_directories('.') cc = meson.get_compiler('c') +cdata = configuration_data() # config.h +pc_conf = configuration_data() # orc.pc + # -Bsymbolic-functions if meson.version().version_compare('>= 0.46.0') if cc.has_link_argument('-Wl,-Bsymbolic-functions') @@ -26,10 +29,17 @@ if meson.version().version_compare('>= 0.46.0') endif endif -cdata = configuration_data() # config.h -pc_conf = configuration_data() # orc.pc - -cdata.set('ORC_EXPORTS', true) +# Symbol visibility +if cc.get_id() == 'msvc' + export_define = '__declspec(dllexport) extern' +elif cc.has_argument('-fvisibility=hidden') + add_project_arguments('-fvisibility=hidden', language: 'c') + export_define = 'extern __attribute__ ((visibility ("default")))' +else + export_define = 'extern' +endif +# Passing this through the command line would be too messy +cdata.set('ORC_API_EXPORT', export_define) all_backends = ['sse', 'mmx', 'altivec', 'neon', 'mips', 'c64x'] # 'arm' |