[tepl/master.msvc: 35/36] tepl/meson.build: Define _TEPL_EXTERN accordingly



commit c1d9ad07bd944923572b7cbda191820bb0e9dd40
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 b89df36..583c1fd 100644
--- a/tepl/meson.build
+++ b/tepl/meson.build
@@ -108,6 +108,11 @@ tepl_enum_types = GNOME.mkenums_simple(
   install_dir: headers_install_dir
 )
 
+tepl_c_args = [ '-DTEPL_COMPILATION' ]
+if CC.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,
@@ -116,7 +121,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]