[glibmm/glibmm-2-62] tools: Fix 'meson dist'



commit 1156756136e7ffd0c68fe630c6bceb3d6290203b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Mar 2 18:48:42 2020 +0800

    tools: Fix 'meson dist'
    
    The former method of using gendef.exe to generate the import library for
    glibmm_generate_extra_defs somehow breaks 'meson dist' and builds from
    release tarballs, unless one builds giomm first.
    
    Fix this by using the __declspec(dll[ex|im]port) directives, since
    glibmm_generate_extra_defs is a simple utility library.

 tools/extra_defs_gen/generate_extra_defs.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/tools/extra_defs_gen/generate_extra_defs.h b/tools/extra_defs_gen/generate_extra_defs.h
index 300df4ca..8ad6fa73 100644
--- a/tools/extra_defs_gen/generate_extra_defs.h
+++ b/tools/extra_defs_gen/generate_extra_defs.h
@@ -20,6 +20,16 @@
 #include <iostream>
 #include <string>
 
+#if defined (_MSC_VER) && !defined (GLIBMM_GEN_EXTRA_DEFS_STATIC)
+#if defined (GLIBMM_GEN_EXTRA_DEFS_BUILD)
+#define GLIBMM_GEN_EXTRA_DEFS_API __declspec (dllexport)
+#else
+#define GLIBMM_GEN_EXTRA_DEFS_API __declspec (dllimport)
+#endif
+#else
+#define GLIBMM_GEN_EXTRA_DEFS_API
+#endif
+
 /** Function pointer type for functions that determine if a GType is a pointer
  * type.
  */
@@ -30,21 +40,29 @@ using GTypeIsAPointerFunc = bool(*)(GType gtype);
  * @param gtype The GType.
  * @return true if the GType is a GObject or a boxed type, false otherwise.
  */
+GLIBMM_GEN_EXTRA_DEFS_API
 bool gtype_is_a_pointer(GType gtype);
 
+GLIBMM_GEN_EXTRA_DEFS_API
 std::string get_defs(GType gtype, GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
 
+GLIBMM_GEN_EXTRA_DEFS_API
 std::string get_property_with_node_name(
   GParamSpec* pParamSpec, const std::string& strObjectName, const std::string& strNodeName);
 
+GLIBMM_GEN_EXTRA_DEFS_API
 std::string get_properties(GType gtype);
 
+GLIBMM_GEN_EXTRA_DEFS_API
 std::string get_type_name(GType gtype, GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
 
+GLIBMM_GEN_EXTRA_DEFS_API
 std::string get_type_name_parameter(
   GType gtype, GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
 
+GLIBMM_GEN_EXTRA_DEFS_API
 std::string get_type_name_signal(
   GType gtype, GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
 
+GLIBMM_GEN_EXTRA_DEFS_API
 std::string get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);


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