build: Reorganize shell libraries and dependencies

This commit does a few different bit interwined things to the
build steps:

 * Make libtestshell and gnome-control-center share more of the
   variables and resouces;
 * Use 'dependencies' instead of 'link_with' for libshell;
 * Add some visual marks as comments;
This commit is contained in:
Georges Basile Stavracas Neto 2018-11-07 22:16:21 -02:00
parent 9a2c5dc41b
commit 14583e9630
No known key found for this signature in database
GPG key ID: 886C17EE170D1385

View file

@ -34,6 +34,55 @@ i18n.merge_file(
cflags = ['-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)] cflags = ['-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)]
# Common sources between gnome-control-center and
# libtestshell.
common_sources = files(
'cc-application.c',
'cc-log.c',
'cc-object-storage.c',
'cc-panel-loader.c',
'cc-panel.c',
'cc-shell.c',
'cc-panel-list.c',
'cc-window.c',
)
###################
# Generated files #
###################
# Debug
debug_conf = configuration_data()
debug_conf.set('BUGREPORT_URL', 'https://gitlab.gnome.org/GNOME/' + meson.project_name() + '/issues/new')
debug_conf.set10('ENABLE_TRACING', enable_tracing)
common_sources += configure_file(
input : 'cc-debug.h.in',
output : 'cc-debug.h',
configuration : debug_conf
)
#Resources
resource_data = files(
'cc-panel-list.ui',
'cc-window.ui',
'help-overlay.ui',
)
common_sources += gnome.compile_resources(
'resources',
meson.project_name() + '.gresource.xml',
dependencies : resource_data,
export : true
)
############
# libshell #
############
libshell = static_library( libshell = static_library(
'shell', 'shell',
sources : 'cc-shell-model.c', sources : 'cc-shell-model.c',
@ -42,39 +91,24 @@ libshell = static_library(
c_args : cflags c_args : cflags
) )
sources = files( libshell_dep = declare_dependency(
'cc-application.c', include_directories : top_inc,
'cc-log.c', link_with : libshell
'cc-object-storage.c',
'cc-panel-loader.c',
'cc-panel.c',
'cc-shell.c',
'main.c'
) )
resource_data = files(
'cc-panel-list.ui',
'cc-window.ui',
'help-overlay.ui',
)
sources += gnome.compile_resources( ########################
'resources', # gnome-control-center #
meson.project_name() + '.gresource.xml', ########################
dependencies: resource_data,
export: true
)
sources += files( shell_sources = common_sources + files('main.c')
'cc-panel-list.c',
'cc-window.c'
)
shell_deps = common_deps + [ shell_deps = common_deps + [
libdevice_dep, libdevice_dep,
liblanguage_dep, liblanguage_dep,
libwidgets_dep, libwidgets_dep,
x11_dep x11_dep,
libshell_dep,
] ]
if enable_cheese if enable_cheese
@ -85,27 +119,21 @@ if host_is_linux_not_s390
shell_deps += wacom_deps shell_deps += wacom_deps
endif endif
# Debug
debug_conf = configuration_data()
debug_conf.set('BUGREPORT_URL', 'https://gitlab.gnome.org/GNOME/' + meson.project_name() + '/issues/new')
debug_conf.set10('ENABLE_TRACING', enable_tracing)
sources += configure_file(
input : 'cc-debug.h.in',
output : 'cc-debug.h',
configuration : debug_conf
)
executable( executable(
meson.project_name(), meson.project_name(),
sources, shell_sources,
include_directories : top_inc, include_directories : top_inc,
dependencies : shell_deps, dependencies : shell_deps,
c_args : cflags, c_args : cflags,
link_with : panels_libs + [libshell], link_with : panels_libs,
install : true install : true
) )
##################
# lipanel_loader #
##################
# Because it is confusing and somewhat problematic to directly add and compile # Because it is confusing and somewhat problematic to directly add and compile
# cc-panel-loader.o by another directory (i.e. the shell search provider), we # cc-panel-loader.o by another directory (i.e. the shell search provider), we
# have to create a library and link it there, just like libshell.la. # have to create a library and link it there, just like libshell.la.
@ -117,23 +145,18 @@ libpanel_loader = static_library(
c_args : cflags + ['-DCC_PANEL_LOADER_NO_GTYPES'] c_args : cflags + ['-DCC_PANEL_LOADER_NO_GTYPES']
) )
# libshell_test
sources = files( ################
'cc-application.c', # libtestshell #
'cc-log.c', ################
'cc-panel.c',
'cc-panel-list.c',
'cc-shell.c',
'cc-shell-model.c',
'cc-object-storage.c',
)
libtestshell = static_library( libtestshell = static_library(
'testshell', 'testshell',
sources, common_sources,
include_directories : top_inc, include_directories : top_inc,
dependencies : common_deps + [ libwidgets_dep ], dependencies : shell_deps,
c_args : cflags, c_args : cflags,
link_with : panels_libs link_with : panels_libs,
) )
libtestshell_dep = declare_dependency( libtestshell_dep = declare_dependency(
include_directories : top_inc, include_directories : top_inc,