[pangomm/meson.msvc: 6/6] meson: Link in the version resource on Windows



commit a85d9830662c38e35aebed21ee61d64a19140397
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Oct 17 15:46:31 2019 +0800

    meson: Link in the version resource on Windows
    
    For all Windows builds, compile the version resource script (pangomm.rc)
    and link it into the pangomm DLL so that we embed the version info in
    that DLL.

 MSVC_NMake/pangomm/meson.build |  2 +-
 meson.build                    |  3 ++-
 pango/meson.build              |  2 --
 pango/pangomm/meson.build      | 10 +++++++++-
 4 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/MSVC_NMake/pangomm/meson.build b/MSVC_NMake/pangomm/meson.build
index b64b209..700d4ce 100644
--- a/MSVC_NMake/pangomm/meson.build
+++ b/MSVC_NMake/pangomm/meson.build
@@ -3,7 +3,7 @@
 # Input: pkg_conf_data, project_build_root
 # Output: -
 
-configure_file(
+pangomm_rc = configure_file(
   input: 'pangomm.rc.in',
   output: '@BASENAME@',
   configuration: pkg_conf_data,
diff --git a/meson.build b/meson.build
index 5ef959b..9b8a6c8 100644
--- a/meson.build
+++ b/meson.build
@@ -231,8 +231,9 @@ endif
 subdir('tools/extra_defs_gen')
 subdir('MSVC_NMake/gendef')
 subdir('pango')
-subdir('docs/reference')
 subdir('MSVC_NMake/pangomm')
+subdir('pango/pangomm')
+subdir('docs/reference')
 
 if not meson.is_subproject()
   # Add a ChangeLog file to the distribution directory.
diff --git a/pango/meson.build b/pango/meson.build
index 08b0ad4..368bd35 100644
--- a/pango/meson.build
+++ b/pango/meson.build
@@ -47,5 +47,3 @@ configure_file(
   configuration: pkg_conf_data,
   install_dir: install_includeconfigdir,
 )
-
-subdir('pangomm')
diff --git a/pango/pangomm/meson.build b/pango/pangomm/meson.build
index 8ff7733..36af9b6 100644
--- a/pango/pangomm/meson.build
+++ b/pango/pangomm/meson.build
@@ -169,6 +169,7 @@ else # not maintainer_mode
 
   pangomm_def = []
   pangomm_extra_link_args = []
+  extra_pangomm_objects = []
 
   if is_msvc
     pangomm_def = custom_target('pangomm.def',
@@ -185,7 +186,14 @@ else # not maintainer_mode
     pangomm_extra_link_args = ['/def:@0@'.format(pangomm_def.full_path())]
   endif
 
-  pangomm_library = library(pangomm_pcname,
+  # Build the .rc file for Windows builds and link to it
+  if host_machine.system() == 'windows'
+    windows = import('windows')
+    pangomm_res = windows.compile_resources(pangomm_rc)
+    extra_pangomm_objects += pangomm_res
+  endif
+
+  pangomm_library = library(pangomm_pcname, extra_pangomm_objects,
     objects: pango_int_lib.extract_all_objects(),
     version: pangomm_libversion,
     dependencies: pangomm_build_dep,


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