From abe3d02ba618431dd4ac6ac3e463727db1239084 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 27 Dec 2019 10:36:00 +0800 Subject: meson: Build Windows .rc files on Windows This ensures that on Windows, the version info resources are indeed linked into the libsigc++ DLL. --- MSVC_NMake/meson.build | 2 +- sigc++/meson.build | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/MSVC_NMake/meson.build b/MSVC_NMake/meson.build index e9964ca..510daa4 100644 --- a/MSVC_NMake/meson.build +++ b/MSVC_NMake/meson.build @@ -3,7 +3,7 @@ # Input: pkg_conf_data, project_build_root, python3 # Output: - -configure_file( +sigc_rc = configure_file( input: 'sigc.rc.in', output: '@BASENAME@', configuration: pkg_conf_data, diff --git a/sigc++/meson.build b/sigc++/meson.build index 3ab7c69..519e3cb 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -69,15 +69,24 @@ install_headers(functors_h_files, subdir: sigcxx_pcname / 'sigc++' / 'functors') install_headers(tuple_utils_h_files, subdir: sigcxx_pcname / 'sigc++' / 'tuple-utils') extra_sigc_cppflags = [] +extra_sigc_objects = [] # Make sure we are exporting the symbols from the DLL if is_msvc extra_sigc_cppflags += ['-DSIGC_BUILD', '-D_WINDLL'] endif +# Build the .rc file for Windows builds and link to it +if host_machine.system() == 'windows' + windows = import('windows') + sigc_res = windows.compile_resources(sigc_rc) + extra_sigc_objects += sigc_res +endif + extra_include_dirs = ['..'] sigcxx_library = library(sigcxx_pcname, source_cc_files, + extra_sigc_objects, version: sigcxx_libversion, include_directories: extra_include_dirs, cpp_args: extra_sigc_cppflags, -- cgit v1.2.1