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.
This commit is contained in:
@ -47,11 +47,10 @@ libappconfig = static_library('appconfig',
|
|||||||
test('app-config',
|
test('app-config',
|
||||||
executable('test-config',
|
executable('test-config',
|
||||||
[ 'test-config.c', app_debug_files, ],
|
[ 'test-config.c', app_debug_files, ],
|
||||||
include_directories: [ rootInclude, rootAppInclude, ],
|
|
||||||
|
|
||||||
dependencies: [
|
dependencies: [
|
||||||
gegl, gio, gio_specific,
|
|
||||||
appstream_glib,
|
appstream_glib,
|
||||||
|
libapp_dep,
|
||||||
],
|
],
|
||||||
link_with: [
|
link_with: [
|
||||||
libgimpbase,
|
libgimpbase,
|
||||||
@ -61,21 +60,7 @@ test('app-config',
|
|||||||
libgimpmodule,
|
libgimpmodule,
|
||||||
libgimpthumb,
|
libgimpthumb,
|
||||||
|
|
||||||
libappcore,
|
|
||||||
libappconfig,
|
libappconfig,
|
||||||
libappfile,
|
|
||||||
libappfiledata,
|
|
||||||
libappgegl,
|
|
||||||
libappinternalprocs,
|
|
||||||
libapplayermodes,
|
|
||||||
libapplayermodeslegacy,
|
|
||||||
libappoperations,
|
|
||||||
libapppaint,
|
|
||||||
libapppdb,
|
|
||||||
libappplugin,
|
|
||||||
libapptext,
|
|
||||||
libappvectors,
|
|
||||||
libappxcf,
|
|
||||||
],
|
],
|
||||||
install: false,
|
install: false,
|
||||||
),
|
),
|
||||||
|
103
app/meson.build
103
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
|
# Those subdirs need to link against the first ones
|
||||||
subdir('config')
|
subdir('config')
|
||||||
subdir('tests')
|
subdir('tests')
|
||||||
@ -81,20 +136,6 @@ subdir('tests')
|
|||||||
|
|
||||||
app_links = [
|
app_links = [
|
||||||
libappconfig,
|
libappconfig,
|
||||||
libappcore,
|
|
||||||
libappfile,
|
|
||||||
libappfiledata,
|
|
||||||
libappgegl,
|
|
||||||
libappinternalprocs,
|
|
||||||
libapplayermodes,
|
|
||||||
libapplayermodeslegacy,
|
|
||||||
libappoperations,
|
|
||||||
libapppaint,
|
|
||||||
libapppdb,
|
|
||||||
libappplugin,
|
|
||||||
libapptext,
|
|
||||||
libappvectors,
|
|
||||||
libappxcf,
|
|
||||||
libgimpbase,
|
libgimpbase,
|
||||||
libgimpcolor,
|
libgimpcolor,
|
||||||
libgimpconfig,
|
libgimpconfig,
|
||||||
@ -115,20 +156,6 @@ app_gui_links = [
|
|||||||
libgimpwidgets,
|
libgimpwidgets,
|
||||||
]
|
]
|
||||||
|
|
||||||
app_deps = [
|
|
||||||
dbghelp,
|
|
||||||
drmingw,
|
|
||||||
gegl,
|
|
||||||
gexiv2,
|
|
||||||
gio,
|
|
||||||
gtk3,
|
|
||||||
lcms,
|
|
||||||
libbacktrace,
|
|
||||||
pangocairo,
|
|
||||||
pangoft2,
|
|
||||||
rpc,
|
|
||||||
]
|
|
||||||
|
|
||||||
# Executables
|
# Executables
|
||||||
|
|
||||||
if platform_windows
|
if platform_windows
|
||||||
@ -167,21 +194,9 @@ if platform_windows
|
|||||||
rootInclude, appInclude,
|
rootInclude, appInclude,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
# for GimpDashboard and GimpBacktrace
|
|
||||||
psapi_cflags = [ '-DPSAPI_VERSION=1' ]
|
|
||||||
link_args = [ '-lpsapi' ]
|
|
||||||
|
|
||||||
else
|
else
|
||||||
console_rc_file = []
|
console_rc_file = []
|
||||||
gui_rc_file = []
|
gui_rc_file = []
|
||||||
|
|
||||||
psapi_cflags = [ ]
|
|
||||||
link_args = []
|
|
||||||
endif
|
|
||||||
|
|
||||||
if platform_osx
|
|
||||||
link_args += osx_ldflags
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gimpconsole_exe = executable('gimp-console-'+gimp_app_version,
|
gimpconsole_exe = executable('gimp-console-'+gimp_app_version,
|
||||||
@ -194,12 +209,10 @@ gimpconsole_exe = executable('gimp-console-'+gimp_app_version,
|
|||||||
'-DGIMP_CONSOLE_COMPILATION',
|
'-DGIMP_CONSOLE_COMPILATION',
|
||||||
psapi_cflags,
|
psapi_cflags,
|
||||||
],
|
],
|
||||||
include_directories: rootInclude,
|
dependencies: libapp_dep,
|
||||||
dependencies: app_deps,
|
|
||||||
link_with: [
|
link_with: [
|
||||||
app_links,
|
app_links,
|
||||||
],
|
],
|
||||||
link_args: link_args,
|
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -212,12 +225,10 @@ gimpmain_exe = executable('gimp-'+gimp_app_version,
|
|||||||
'-DGIMP_APP_GLUE_COMPILATION',
|
'-DGIMP_APP_GLUE_COMPILATION',
|
||||||
psapi_cflags,
|
psapi_cflags,
|
||||||
],
|
],
|
||||||
include_directories: rootInclude,
|
dependencies: libapp_dep,
|
||||||
dependencies: app_deps,
|
|
||||||
link_with: [
|
link_with: [
|
||||||
app_links,
|
app_links,
|
||||||
app_gui_links,
|
app_gui_links,
|
||||||
],
|
],
|
||||||
link_args: link_args,
|
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
@ -1,43 +1,13 @@
|
|||||||
|
|
||||||
apptests_includes = [
|
|
||||||
rootInclude, rootAppInclude
|
|
||||||
]
|
|
||||||
apptests_deps = [
|
|
||||||
appstream_glib,
|
|
||||||
dbghelp,
|
|
||||||
drmingw,
|
|
||||||
gegl,
|
|
||||||
gtk3,
|
|
||||||
libbacktrace,
|
|
||||||
pangocairo,
|
|
||||||
pangoft2,
|
|
||||||
]
|
|
||||||
apptests_links = [
|
apptests_links = [
|
||||||
libapp,
|
|
||||||
libappactions,
|
|
||||||
libappconfig,
|
libappconfig,
|
||||||
libappcore,
|
libappactions,
|
||||||
libappdialogs,
|
|
||||||
libappdialogs,
|
libappdialogs,
|
||||||
libappdisplay,
|
libappdisplay,
|
||||||
libappfile,
|
|
||||||
libappfiledata,
|
|
||||||
libappgegl,
|
|
||||||
libappgui,
|
libappgui,
|
||||||
libappinternalprocs,
|
|
||||||
libapplayermodes,
|
|
||||||
libapplayermodeslegacy,
|
|
||||||
libappmenus,
|
libappmenus,
|
||||||
libappoperations,
|
|
||||||
libapppaint,
|
|
||||||
libapppdb,
|
|
||||||
libappplugin,
|
|
||||||
libapppropgui,
|
libapppropgui,
|
||||||
libapptext,
|
|
||||||
libapptools,
|
libapptools,
|
||||||
libappvectors,
|
|
||||||
libappwidgets,
|
libappwidgets,
|
||||||
libappxcf,
|
|
||||||
libgimpbase,
|
libgimpbase,
|
||||||
libgimpcolor,
|
libgimpcolor,
|
||||||
libgimpconfig,
|
libgimpconfig,
|
||||||
@ -55,8 +25,7 @@ libapptestutils_sources = [
|
|||||||
|
|
||||||
libapptestutils = static_library('apptestutils',
|
libapptestutils = static_library('apptestutils',
|
||||||
libapptestutils_sources,
|
libapptestutils_sources,
|
||||||
include_directories: apptests_includes,
|
dependencies: libapp_dep,
|
||||||
dependencies: apptests_deps,
|
|
||||||
link_with: apptests_links,
|
link_with: apptests_links,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -78,8 +47,7 @@ app_tests = [
|
|||||||
foreach test_name : app_tests
|
foreach test_name : app_tests
|
||||||
test_exe = executable(test_name,
|
test_exe = executable(test_name,
|
||||||
'test-@0@.c'.format(test_name),
|
'test-@0@.c'.format(test_name),
|
||||||
include_directories: apptests_includes,
|
dependencies: [ libapp_dep, appstream_glib ],
|
||||||
dependencies: apptests_deps,
|
|
||||||
link_with: apptests_links,
|
link_with: apptests_links,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user