[libgweather] build: Non-MSVC compilers support declspec extern
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather] build: Non-MSVC compilers support declspec extern
- Date: Mon, 27 Nov 2017 13:50:35 +0000 (UTC)
commit 02e3d9eff426dc660b23e6c9b165410fe02359e9
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Nov 27 13:45:11 2017 +0000
build: Non-MSVC compilers support declspec extern
This was cargo-culted from the Autotools build of other projects, but
GCC and Clang support the same syntax as MSVC for externally visible
symbols. The only thing that is GCC-specific is the compiler argument,
as MSVC automatically marks all symbols as hidden.
meson.build | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index 9a22630..64be305 100644
--- a/meson.build
+++ b/meson.build
@@ -72,10 +72,8 @@ config_h.set_quoted('OWM_APIKEY', get_option('owm_apikey'))
if get_option('default_library') != 'static'
if host_machine.system() == 'windows'
config_h.set('DLL_EXPORT', true)
- if cc.get_id() == 'msvc'
- config_h.set('GWEATHER_EXTERN', '__declspec(dllexport) extern')
- else
- config_h.set('GWEATHER_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern')
+ config_h.set('GWEATHER_EXTERN', '__declspec(dllexport) extern')
+ if cc.get_id() != 'msvc'
add_global_arguments(['-fvisibility=hidden'], language: 'c')
endif
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]