[amtk/meson-msvc: 2/7] meson: Fix building amtk on Visual Studio-style compilers



commit a606f2935fbe694182e83701ed44dc3546a4557f
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]