From 1e37c0eeb1e2a03a524100683980d99f8ee7bc31 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 2 Mar 2020 15:49:35 +0800 Subject: glib/glibmm/meson.build: Use glibmm-int rule for all builds Let builds from release tarballs and GIT checkouts build the glibmm-int static library, and link the final .so/.dll from the objects that form glibmm-int static .lib. By doing so we can build glibmm with the import libraries for Visual Studio builds with gendef, as well as linking in the version resource for all Windows builds. --- glib/glibmm/meson.build | 71 ++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) (limited to 'glib') diff --git a/glib/glibmm/meson.build b/glib/glibmm/meson.build index 29acfdac..a21ef139 100644 --- a/glib/glibmm/meson.build +++ b/glib/glibmm/meson.build @@ -231,13 +231,12 @@ if maintainer_mode ) extra_include_dirs = ['..'] - glibmm_library = library(glibmm_pcname, + glib_int_lib = static_library('glibmm-int', glibmm_built_cc_file_targets, glibmm_extra_cc_files, built_dummy_h_file_target, - version: glibmm_libversion, include_directories: extra_include_dirs, cpp_args: '-DGLIBMM_BUILD=1', dependencies: glibmm_build_dep, - install: true, + install: false, ) built_h_cc_dir = meson.current_build_dir() @@ -293,44 +292,44 @@ else # not maintainer_mode install: false, ) - glibmm_def = [] - glibmm_extra_link_args = [] - extra_glibmm_objects = [] + built_h_cc_dir = src_untracked_glibmm - if is_msvc - glibmm_def = custom_target('glibmm.def', - output: 'glibmm.def', - depends: glib_int_lib, - command: [ gendef, - '@OUTPUT@', - '@0@-@1@.dll'.format(glibmm_pcname, glibmm_libversion.split('.')[0]), - glib_int_lib.full_path(), - ], - install: false, - ) - glibmm_extra_link_args = ['/def:@0@'.format(glibmm_def.full_path())] - endif - - # Build the .rc file for Windows builds and link to it - if is_host_windows - windows = import('windows') - glibmm_res = windows.compile_resources(glibmm_rc) - extra_glibmm_objects += glibmm_res - endif - - glibmm_library = library(glibmm_pcname, extra_glibmm_objects, - objects: glib_int_lib.extract_all_objects(), - version: glibmm_libversion, - dependencies: glibmm_build_dep, - link_depends: glibmm_def, - link_args: glibmm_extra_link_args, - install: true, - ) +endif - built_h_cc_dir = src_untracked_glibmm +glibmm_def = [] +glibmm_extra_link_args = [] +extra_glibmm_objects = [] + +if is_msvc + glibmm_def = custom_target('glibmm.def', + output: 'glibmm.def', + depends: glib_int_lib, + command: [ gendef, + '@OUTPUT@', + '@0@-@1@.dll'.format(glibmm_pcname, glibmm_libversion.split('.')[0]), + glib_int_lib.full_path(), + ], + install: false, + ) + glibmm_extra_link_args = ['/def:@0@'.format(glibmm_def.full_path())] +endif +# Build the .rc file for Windows builds and link to it +if is_host_windows + windows = import('windows') + glibmm_res = windows.compile_resources(glibmm_rc) + extra_glibmm_objects += glibmm_res endif +glibmm_library = library(glibmm_pcname, extra_glibmm_objects, + objects: glib_int_lib.extract_all_objects(), + version: glibmm_libversion, + dependencies: glibmm_build_dep, + link_depends: glibmm_def, + link_args: glibmm_extra_link_args, + install: true, +) + # Install built .h and _p.h files. meson.add_install_script( python3.path(), generate_binding_py, 'install_built_h_files', -- cgit v1.2.1