[gimp/wip/nielsdg/meson-fix-test-build] meson: Cleanup and fix issues using libapp_dep
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/nielsdg/meson-fix-test-build] meson: Cleanup and fix issues using libapp_dep
- Date: Mon, 11 May 2020 10:04:41 +0000 (UTC)
commit cd813d17505c30b86dba1757cfe6cc149685c60e
Author: Niels De Graef <nielsdegraef gmail com>
Date: Mon May 11 05:55:37 2020 +0200
meson: Cleanup and fix issues using libapp_dep
Meson has a very useful tool for combining a set of linked libraries and
compiler arguments (like an internal pkg-config):
`declare_dependency()`. Use this command to ensure that we can easily
reuse libapp* over multiple libraries, executables and tests.
That way, if we also add a new dependency later on in one of the libapp
libraries, this won't need to be added multiple times.
app/config/meson.build | 17 +-------
app/meson.build | 103 +++++++++++++++++++++++++++----------------------
app/tests/meson.build | 38 ++----------------
3 files changed, 61 insertions(+), 97 deletions(-)
---
diff --git a/app/config/meson.build b/app/config/meson.build
index 4354a8059a..b36285fe5e 100644
--- a/app/config/meson.build
+++ b/app/config/meson.build
@@ -47,11 +47,10 @@ libappconfig = static_library('appconfig',
test('app-config',
executable('test-config',
[ 'test-config.c', app_debug_files, ],
- include_directories: [ rootInclude, rootAppInclude, ],
dependencies: [
- gegl, gio, gio_specific,
appstream_glib,
+ libapp_dep,
],
link_with: [
libgimpbase,
@@ -61,21 +60,7 @@ test('app-config',
libgimpmodule,
libgimpthumb,
- libappcore,
libappconfig,
- libappfile,
- libappfiledata,
- libappgegl,
- libappinternalprocs,
- libapplayermodes,
- libapplayermodeslegacy,
- libappoperations,
- libapppaint,
- libapppdb,
- libappplugin,
- libapptext,
- libappvectors,
- libappxcf,
],
install: false,
),
diff --git a/app/meson.build b/app/meson.build
index 8637baaeed..6f615c6e7c 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -73,6 +73,61 @@ libapp = static_library('app',
)
+if platform_windows
+ # for GimpDashboard and GimpBacktrace
+ psapi_cflags = [ '-DPSAPI_VERSION=1' ]
+ link_args = [ '-lpsapi' ]
+
+else
+ psapi_cflags = [ ]
+ link_args = []
+endif
+
+if platform_osx
+ link_args += osx_ldflags
+endif
+
+libapp_dep = declare_dependency(
+ dependencies: [
+ dbghelp,
+ drmingw,
+ gegl,
+ gexiv2,
+ gio,
+ gio_specific,
+ gtk3,
+ lcms,
+ libbacktrace,
+ pangocairo,
+ pangoft2,
+ rpc,
+ ],
+ link_with: [
+ libapp,
+ libappcore,
+ libappfile,
+ libappfiledata,
+ libappgegl,
+ libappinternalprocs,
+ libapplayermodes,
+ libapplayermodeslegacy,
+ libappoperations,
+ libapppaint,
+ libapppdb,
+ libappplugin,
+ libapptext,
+ libappvectors,
+ libappxcf,
+ ],
+ include_directories: [
+ rootInclude,
+ rootAppInclude,
+ ],
+ compile_args: psapi_cflags,
+ link_args: link_args,
+)
+
+
# Those subdirs need to link against the first ones
subdir('config')
subdir('tests')
@@ -81,20 +136,6 @@ subdir('tests')
app_links = [
libappconfig,
- libappcore,
- libappfile,
- libappfiledata,
- libappgegl,
- libappinternalprocs,
- libapplayermodes,
- libapplayermodeslegacy,
- libappoperations,
- libapppaint,
- libapppdb,
- libappplugin,
- libapptext,
- libappvectors,
- libappxcf,
libgimpbase,
libgimpcolor,
libgimpconfig,
@@ -115,20 +156,6 @@ app_gui_links = [
libgimpwidgets,
]
-app_deps = [
- dbghelp,
- drmingw,
- gegl,
- gexiv2,
- gio,
- gtk3,
- lcms,
- libbacktrace,
- pangocairo,
- pangoft2,
- rpc,
-]
-
# Executables
if platform_windows
@@ -167,21 +194,9 @@ if platform_windows
rootInclude, appInclude,
],
)
-
- # for GimpDashboard and GimpBacktrace
- psapi_cflags = [ '-DPSAPI_VERSION=1' ]
- link_args = [ '-lpsapi' ]
-
else
console_rc_file = []
gui_rc_file = []
-
- psapi_cflags = [ ]
- link_args = []
-endif
-
-if platform_osx
- link_args += osx_ldflags
endif
gimpconsole_exe = executable('gimp-console-'+gimp_app_version,
@@ -194,12 +209,10 @@ gimpconsole_exe = executable('gimp-console-'+gimp_app_version,
'-DGIMP_CONSOLE_COMPILATION',
psapi_cflags,
],
- include_directories: rootInclude,
- dependencies: app_deps,
+ dependencies: libapp_dep,
link_with: [
app_links,
],
- link_args: link_args,
install: true,
)
@@ -212,12 +225,10 @@ gimpmain_exe = executable('gimp-'+gimp_app_version,
'-DGIMP_APP_GLUE_COMPILATION',
psapi_cflags,
],
- include_directories: rootInclude,
- dependencies: app_deps,
+ dependencies: libapp_dep,
link_with: [
app_links,
app_gui_links,
],
- link_args: link_args,
install: true,
)
diff --git a/app/tests/meson.build b/app/tests/meson.build
index c41e71f8f5..7b3cca1c9b 100644
--- a/app/tests/meson.build
+++ b/app/tests/meson.build
@@ -1,43 +1,13 @@
-
-apptests_includes = [
- rootInclude, rootAppInclude
-]
-apptests_deps = [
- appstream_glib,
- dbghelp,
- drmingw,
- gegl,
- gtk3,
- libbacktrace,
- pangocairo,
- pangoft2,
-]
apptests_links = [
- libapp,
- libappactions,
libappconfig,
- libappcore,
- libappdialogs,
+ libappactions,
libappdialogs,
libappdisplay,
- libappfile,
- libappfiledata,
- libappgegl,
libappgui,
- libappinternalprocs,
- libapplayermodes,
- libapplayermodeslegacy,
libappmenus,
- libappoperations,
- libapppaint,
- libapppdb,
- libappplugin,
libapppropgui,
- libapptext,
libapptools,
- libappvectors,
libappwidgets,
- libappxcf,
libgimpbase,
libgimpcolor,
libgimpconfig,
@@ -55,8 +25,7 @@ libapptestutils_sources = [
libapptestutils = static_library('apptestutils',
libapptestutils_sources,
- include_directories: apptests_includes,
- dependencies: apptests_deps,
+ dependencies: libapp_dep,
link_with: apptests_links,
)
@@ -78,8 +47,7 @@ app_tests = [
foreach test_name : app_tests
test_exe = executable(test_name,
'test-@0@.c'.format(test_name),
- include_directories: apptests_includes,
- dependencies: apptests_deps,
+ dependencies: [ libapp_dep, appstream_glib ],
link_with: apptests_links,
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]