[pangomm/use-dllexport-2-42: 7/17] meson.build: Enable dllexport when possible in maintainer mode



commit 3a28114dab7ea865128f55cc38a9635d292edf59
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Mar 18 18:24:35 2020 +0800

    meson.build: Enable dllexport when possible in maintainer mode
    
    Note that this does not yet build pangomm with __declspec(dllexport), but
    paves the way for enabling such support eventually.
    
    This adds machinery to meson.build to check whether we can build pangomm
    without gendef.exe, by checking whether we are building against
    glibmm-2.64.0 or later.
    
    This is because we may be using glibmm before 2.64.0, which did not have the
    mechanics in gmmproc to generate the pangomm headers with decorations in the
    prototypes, which is necessary to properly build pangomm using
    __declspec(dllexport) and without gendef.exe
    
    Similar updates for release tarballs and NMake will follow later.

 meson.build | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index c2ff5d8..5253a48 100644
--- a/meson.build
+++ b/meson.build
@@ -138,12 +138,29 @@ if is_msvc
     cairomm_dep = cairomm_dep.found() ? cairomm_dep : 
cpp_compiler.find_library('cairomm-vc@0@0@1@-1_@2@'.format(v.to_string(), debugsuffix, 
cairomm_req_minor_ver), required: false)
   endforeach
 
-  if glibmm_dep.type_name() == 'library'
+  # Check whether we compile pangomm without using gendef
+  use_dll_export = false
+
+  # If we are building using maintainer mode, check whether we are on 2.64.0 or later
+  if glibmm_dep.type_name() == 'pkgconfig'
+    if glibmm_dep.version() >= '2.64.0' and maintainer_mode
+      use_dll_export = true
+    endif
+  elif glibmm_dep.type_name() == 'library'
     warning('Note: Be sure to check that this finds the same libsigc++ .lib your glibmm is linked to')
     sigc_dep = cpp_compiler.find_library('sigc-@0@.0'.format(sigc_major_ver), required: false)
     foreach v : msvc_check_range
       sigc_dep = sigc_dep.found() ? sigc_dep : 
cpp_compiler.find_library('sigc-vc@0@0@1@-2_0'.format(v.to_string(), debugsuffix), required: false)
     endforeach
+
+    # Check for API added in 2.64.0 to build without gendef in mtaintainer mode
+    if maintainer_mode and cpp_compiler.has_function(
+         'Glib::get_host_name',
+         prefix: '#include <glibmm/miscutils.h>',
+         dependencies: glibmm_dep
+       )
+      use_dll_export = true
+    endif
   endif
 
   # Now make sure the appropriate -mm libraries are found


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