[gtk/wip/fanc999/meson.msvc: 165/168] meson: Build .rc files for Windows



commit 59cf9ca1d7a0a60fe8dced17e6d529d71617b916
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Aug 7 19:10:18 2017 +0800

    meson: Build .rc files for Windows
    
    Build the .rc files for Windows so that one can track the version info
    more easily for Windows, as well as giving GTK+ apps a default icon.
    
    Also, move back the manifest embedding for the themed Windows print
    dialog back into gtk-win32.rc.body.in, so that we just have one way of
    embedding this manifest file, making things easier for ourselves, as
    this is supported in the later Visual Studio compilers as well, which is
    2013 and later.

 gdk/meson.build          |  1 +
 gtk/gtk-win32.rc.body.in |  9 ++++++---
 gtk/meson.build          | 17 +++++++++++++++++
 3 files changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/gdk/meson.build b/gdk/meson.build
index d68307392b..2ed2585f0f 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -160,6 +160,7 @@ gdkx11_inc = include_directories('x11')
 gdkwayland_inc = include_directories('wayland')
 
 wlinc = include_directories('.')
+win32rcinc = include_directories('win32/rc')
 
 gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros]
 
diff --git a/gtk/gtk-win32.rc.body.in b/gtk/gtk-win32.rc.body.in
index 251128fe48..b876a6ddf5 100644
--- a/gtk/gtk-win32.rc.body.in
+++ b/gtk/gtk-win32.rc.body.in
@@ -1,3 +1,4 @@
+#include <winuser.h>
 #include <winver.h>
 
 GTK_ICON               ICON                    "gtk.ico"
@@ -18,9 +19,9 @@ VS_VERSION_INFO VERSIONINFO
        VALUE "CompanyName", "The GTK developer community"
        VALUE "FileDescription", "GIMP Toolkit"
        VALUE "FileVersion", "@GTK_VERSION@.0"
-       VALUE "InternalName", "libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@"
-       VALUE "LegalCopyright", "Copyright � 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. 
Modified by the GTK+ Team and others 1997-2011."
-       VALUE "OriginalFilename", "libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll"
+       VALUE "InternalName", "libgtk-win32-@GTK_API_VERSION@"
+       VALUE "LegalCopyright", "Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. 
Modified by the GTK+ Team and others 1997-2011."
+       VALUE "OriginalFilename", "libgtk-win32-@GTK_API_VERSION@.dll"
        VALUE "ProductName", "GTK+"
        VALUE "ProductVersion", "@GTK_VERSION@"
       END
@@ -30,3 +31,5 @@ VS_VERSION_INFO VERSIONINFO
       VALUE "Translation", 0x409, 1200
     END
   END
+
+ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST libgtk4.manifest
\ No newline at end of file
diff --git a/gtk/meson.build b/gtk/meson.build
index 96a0c4283f..39a2d98cd7 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -842,6 +842,12 @@ gtkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version)
 gtkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version)
 gtkversion_cdata.set('GTK_BINARY_AGE', gtk_binary_age)
 gtkversion_cdata.set('GTK_INTERFACE_AGE', gtk_interface_age)
+gtkversion_cdata.set('GTK_VERSION', gtk_version)
+gtkversion_cdata.set('GTK_API_VERSION', gtk_api_version)
+
+if host_machine.system() == 'windows'
+  gtkversion_cdata.set('EXE_MANIFEST_ARCHITECTURE', '*')
+endif
 
 gtkversion = configure_file(input: 'gtkversion.h.in',
                             output: 'gtkversion.h',
@@ -917,6 +923,17 @@ if win32_enabled
                cc.find_library('imm32'),
                cc.find_library('setupapi'),
                cc.find_library('winmm')]
+
+  gtkwin32rc = configure_file(input: 'gtk-win32.rc.body.in',
+                              output: 'gtk-win32.rc.body',
+                              configuration: gtkversion_cdata)
+
+  win32_manifest = configure_file(input: 'libgtk4.manifest.in',
+                                  output: 'libgtk4.manifest',
+                                  configuration: gtkversion_cdata)
+
+  win32res = import('windows').compile_resources(gtkwin32rc, include_directories : win32rcinc)
+  gtk_sources += win32res
 else
   gtk_deps += [ atkbridge_dep, ]
 endif


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