public inbox for [email protected]  
help / color / mirror / Atom feed
From: Noah Misch <[email protected]>
To: [email protected]
Subject: win32ver data in meson-built postgres.exe
Date: Wed, 7 Jun 2023 16:14:07 -0700
Message-ID: <[email protected]> (raw)

A postgres.exe built with meson, ninja, and MSVC lacks the version metadata
that postgres.exe gets under non-meson build systems.  Patch attached.

Author:     Noah Misch <[email protected]>
Commit:     Noah Misch <[email protected]>

    Add win32ver data to meson-built postgres.exe.
    
    This preserves two quirks of the older build systems.  First,
    postgres.exe is icon-free.  Second, the resources object is not an input
    to postgres.def.
    
    Reviewed by FIXME.
    
    Discussion: https://postgr.es/m/FIXME

diff --git a/meson.build b/meson.build
index 16b2e86..6d88836 100644
--- a/meson.build
+++ b/meson.build
@@ -2714,9 +2714,12 @@ if host_system == 'windows'
     rcgen_base_args += ['--depfile', '@DEPFILE@']
   endif
 
-  rcgen_bin_args = rcgen_base_args + [
+  rcgen_server_args = rcgen_base_args + [
     '--VFT_TYPE', 'VFT_APP',
-    '--FILEENDING', 'exe',
+    '--FILEENDING', 'exe'
+  ]
+
+  rcgen_bin_args = rcgen_server_args + [
     '--ICO', pg_ico
   ]
 
@@ -2731,6 +2734,12 @@ if host_system == 'windows'
     output: rcgen_outputs,
   )
 
+  rc_server_gen = generator(rcgen,
+    depfile: '@[email protected]',
+    arguments: rcgen_server_args,
+    output: rcgen_outputs,
+  )
+
   rc_lib_gen = generator(rcgen,
     depfile: '@[email protected]',
     arguments: rcgen_lib_args,
diff --git a/src/backend/meson.build b/src/backend/meson.build
index ccfc382..0e56b7f 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -5,6 +5,7 @@ backend_sources = []
 backend_link_with = [pgport_srv, common_srv]
 
 generated_backend_sources = []
+post_export_backend_sources = []
 
 subdir('access')
 subdir('archive')
@@ -133,8 +134,15 @@ if dtrace.found() and host_system != 'darwin'
   )
 endif
 
+if host_system == 'windows'
+  post_export_backend_sources += rc_server_gen.process(win32ver_rc, extra_args: [
+    '--NAME', 'postgres',
+    '--FILEDESC', 'PostgreSQL Server',])
+endif
+
 postgres = executable('postgres',
   backend_input,
+  sources: post_export_backend_sources,
   objects: backend_objs,
   link_args: backend_link_args,
   link_with: backend_link_with,


Attachments:

  [text/plain] win32ver-backend-meson-v1.patch (1.9K, ../[email protected]/2-win32ver-backend-meson-v1.patch)
  download | inline diff:
Author:     Noah Misch <[email protected]>
Commit:     Noah Misch <[email protected]>

    Add win32ver data to meson-built postgres.exe.
    
    This preserves two quirks of the older build systems.  First,
    postgres.exe is icon-free.  Second, the resources object is not an input
    to postgres.def.
    
    Reviewed by FIXME.
    
    Discussion: https://postgr.es/m/FIXME

diff --git a/meson.build b/meson.build
index 16b2e86..6d88836 100644
--- a/meson.build
+++ b/meson.build
@@ -2714,9 +2714,12 @@ if host_system == 'windows'
     rcgen_base_args += ['--depfile', '@DEPFILE@']
   endif
 
-  rcgen_bin_args = rcgen_base_args + [
+  rcgen_server_args = rcgen_base_args + [
     '--VFT_TYPE', 'VFT_APP',
-    '--FILEENDING', 'exe',
+    '--FILEENDING', 'exe'
+  ]
+
+  rcgen_bin_args = rcgen_server_args + [
     '--ICO', pg_ico
   ]
 
@@ -2731,6 +2734,12 @@ if host_system == 'windows'
     output: rcgen_outputs,
   )
 
+  rc_server_gen = generator(rcgen,
+    depfile: '@[email protected]',
+    arguments: rcgen_server_args,
+    output: rcgen_outputs,
+  )
+
   rc_lib_gen = generator(rcgen,
     depfile: '@[email protected]',
     arguments: rcgen_lib_args,
diff --git a/src/backend/meson.build b/src/backend/meson.build
index ccfc382..0e56b7f 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -5,6 +5,7 @@ backend_sources = []
 backend_link_with = [pgport_srv, common_srv]
 
 generated_backend_sources = []
+post_export_backend_sources = []
 
 subdir('access')
 subdir('archive')
@@ -133,8 +134,15 @@ if dtrace.found() and host_system != 'darwin'
   )
 endif
 
+if host_system == 'windows'
+  post_export_backend_sources += rc_server_gen.process(win32ver_rc, extra_args: [
+    '--NAME', 'postgres',
+    '--FILEDESC', 'PostgreSQL Server',])
+endif
+
 postgres = executable('postgres',
   backend_input,
+  sources: post_export_backend_sources,
   objects: backend_objs,
   link_args: backend_link_args,
   link_with: backend_link_with,


view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: win32ver data in meson-built postgres.exe
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox