Skip to content

Commit 155ff45

Browse files
fanc999-1kjellahl
authored andcommitted
meson: Build Windows .rc files on Windows
This ensures that on Windows, the version info resources are indeed linked into the libsigc++ DLL.
1 parent f394ef6 commit 155ff45

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

MSVC_NMake/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Input: pkg_conf_data, project_build_root, python3
44
# Output: -
55

6-
configure_file(
6+
sigc_rc = configure_file(
77
input: 'sigc.rc.in',
88
output: '@BASENAME@',
99
configuration: pkg_conf_data,

sigc++/meson.build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,20 @@ src_untracked_sigcxx = project_source_root / untracked_sigcxx
9393
handle_built_files = project_source_root / 'tools' / 'handle-built-files.py'
9494

9595
extra_sigc_cppflags = []
96+
extra_sigc_objects = []
9697

9798
# Make sure we are exporting the symbols from the DLL
9899
if is_msvc
99100
extra_sigc_cppflags += ['-DSIGC_BUILD', '-D_WINDLL']
100101
endif
101102

103+
# Build the .rc file for Windows builds and link to it
104+
if host_machine.system() == 'windows'
105+
windows = import('windows')
106+
sigc_res = windows.compile_resources(sigc_rc)
107+
extra_sigc_objects += sigc_res
108+
endif
109+
102110
if maintainer_mode
103111

104112
# Maintainer mode. Generate .h and .cc files from .m4 files in macros/ directories.
@@ -158,6 +166,7 @@ if maintainer_mode
158166
extra_include_dirs = ['..']
159167
sigcxx_library = library(sigcxx_pcname,
160168
source_cc_files, built_cc_file_targets, built_h_file_targets,
169+
extra_sigc_objects,
161170
version: sigcxx_libversion,
162171
cpp_args: extra_sigc_cppflags,
163172
include_directories: extra_include_dirs,
@@ -200,6 +209,7 @@ else # not maintainer_mode
200209
extra_include_dirs = [ '..', '..' / 'untracked' ]
201210
sigcxx_library = library(sigcxx_pcname,
202211
source_cc_files, untracked_built_cc_files,
212+
extra_sigc_objects,
203213
version: sigcxx_libversion,
204214
cpp_args: extra_sigc_cppflags,
205215
include_directories: extra_include_dirs,

0 commit comments

Comments
 (0)