[amtk/meson-msvc: 13/18] meson: Fix building amtk on Visual Studio-style compilers



commit 2de0f42c81280916b3126afe92d425f08cf6f40e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri May 8 13:47:22 2020 +0800

    meson: Fix building amtk on Visual Studio-style compilers
    
    We need to override _AMTK_EXTERN to __declspec(dllexport) extern so that we
    can export the symbols in the library for our import .lib
    
    This is required for Visual Studio builds, as well as clang-cl builds, when we
    support that toolchain.

 amtk/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/amtk/meson.build b/amtk/meson.build
index a5d78e0..585938c 100644
--- a/amtk/meson.build
+++ b/amtk/meson.build
@@ -42,6 +42,10 @@ cargs = [
   '-DAMTK_COMPILATION',
 ]
 
+if meson.get_compiler('c').get_argument_syntax() == 'msvc'
+  cargs += '-D_AMTK_EXTERN=__declspec(dllexport)extern'
+endif
+
 deps = [
   dependency('gtk+-3.0', version : '>=3.22'),
 ]


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