[tepl/master.msvc: 6/8] tepl/meson.build: Define _TEPL_EXTERN accordingly



commit d747ae71de8af38e632785e726b18e37bf434950
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Apr 28 17:13:58 2020 +0800

    tepl/meson.build: Define _TEPL_EXTERN accordingly
    
    ... on Visual Studio-style builds, so that we can export the public
    symbols using '__declspec(dllexport) extern', as using a symbols map file is
    not supported in this situation.

 tepl/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/tepl/meson.build b/tepl/meson.build
index c554961..7b03c3b 100644
--- a/tepl/meson.build
+++ b/tepl/meson.build
@@ -104,6 +104,11 @@ tepl_enum_types = GNOME.mkenums_simple(
   install_dir: headers_install_dir
 )
 
+tepl_c_args = [ '-DTEPL_COMPILATION' ]
+if c_compiler.get_argument_syntax() == 'msvc'
+  tepl_c_args += '-D_TEPL_EXTERN=__declspec(dllexport) extern'
+endif
+
 tepl_static_lib = static_library(
   'tepl-static',
   [tepl_public_c_files,
@@ -112,7 +117,7 @@ tepl_static_lib = static_library(
   pic: true, # tepl_static_lib is linked in a shared library.
   include_directories: ROOT_INCLUDE_DIR,
   dependencies: TEPL_DEPS,
-  c_args: '-DTEPL_COMPILATION'
+  c_args: tepl_c_args
 )
 
 # For unit tests, to be able to test private functions.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]