summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-10-05 09:56:05 -0700
committerAndres Freund <andres@anarazel.de>2022-10-05 09:56:05 -0700
commit902ab2fcef33b1e7c290af8d280e67d9f9212bcf (patch)
tree5797c322cf01409849f1ad3fbed4a1eb1a6760fa /meson.build
parenta1261cd16f07f6db12a54b94d9e36175198951b4 (diff)
downloadpostgresql-902ab2fcef33b1e7c290af8d280e67d9f9212bcf.tar.gz
meson: Add windows resource files
The generated resource files aren't exactly the same ones as the old buildsystems generate. Previously "InternalName" and "OriginalFileName" were mostly wrong / not set (despite being required), but that was hard to fix in at least the make build. Additionally, the meson build falls back to a "auto-generated" description when not set, and doesn't set it in a few cases - unlikely that anybody looks at these descriptions in detail. Author: Andres Freund <andres@anarazel.de> Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build59
1 files changed, 59 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index c709643fe5..25a6fa941c 100644
--- a/meson.build
+++ b/meson.build
@@ -2564,6 +2564,65 @@ gen_export_kwargs = {
+###
+### windows resources related stuff
+###
+
+if host_system == 'windows'
+ pg_ico = meson.source_root() / 'src' / 'port' / 'win32.ico'
+ win32ver_rc = files('src/port/win32ver.rc')
+ rcgen = find_program('src/tools/rcgen', native: true)
+
+ rcgen_base_args = [
+ '--srcdir', '@SOURCE_DIR@',
+ '--builddir', meson.build_root(),
+ '--rcout', '@OUTPUT0@',
+ '--out', '@OUTPUT1@',
+ '--input', '@INPUT@',
+ '@EXTRA_ARGS@',
+ ]
+
+ if cc.get_argument_syntax() == 'msvc'
+ rc = find_program('rc', required: true)
+ rcgen_base_args += ['--rc', rc.path()]
+ rcgen_outputs = ['@BASENAME@.rc', '@BASENAME@.res']
+ else
+ windres = find_program('windres', required: true)
+ rcgen_base_args += ['--windres', windres.path()]
+ rcgen_outputs = ['@BASENAME@.rc', '@BASENAME@.obj']
+ endif
+
+ # msbuild backend doesn't support this atm
+ if meson.backend() == 'ninja'
+ rcgen_base_args += ['--depfile', '@DEPFILE@']
+ endif
+
+ rcgen_bin_args = rcgen_base_args + [
+ '--VFT_TYPE', 'VFT_APP',
+ '--FILEENDING', 'exe',
+ '--ICO', pg_ico
+ ]
+
+ rcgen_lib_args = rcgen_base_args + [
+ '--VFT_TYPE', 'VFT_DLL',
+ '--FILEENDING', 'dll',
+ ]
+
+ rc_bin_gen = generator(rcgen,
+ depfile: '@BASENAME@.d',
+ arguments: rcgen_bin_args,
+ output: rcgen_outputs,
+ )
+
+ rc_lib_gen = generator(rcgen,
+ depfile: '@BASENAME@.d',
+ arguments: rcgen_lib_args,
+ output: rcgen_outputs,
+ )
+endif
+
+
+
# headers that the whole build tree depends on
generated_headers = []
# headers that the backend build depends on