build: Include generated sources in declared dependencies
Sometimes ninja decides to compile tests/interactive-panels/main.c, which requires shell/resources.h, before shell/resources.h is generated. The fix is to use 'sources' argument of declare_dependency to properly declare the dependency on generated headers. A fix for tests/datetime and panels/datetime is also included in the commit to fix a similar problem. Closes https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/472
This commit is contained in:
parent
6d16bf7337
commit
299647f970
3 changed files with 14 additions and 6 deletions
|
@ -192,5 +192,11 @@ datetime_panel_lib = static_library(
|
||||||
)
|
)
|
||||||
panels_libs += datetime_panel_lib
|
panels_libs += datetime_panel_lib
|
||||||
|
|
||||||
|
datetime_panel_lib_dep = declare_dependency(
|
||||||
|
sources : resources,
|
||||||
|
include_directories : [top_inc, include_directories('.')],
|
||||||
|
link_with : datetime_panel_lib
|
||||||
|
)
|
||||||
|
|
||||||
subdir('po-timezones')
|
subdir('po-timezones')
|
||||||
subdir('icons')
|
subdir('icons')
|
||||||
|
|
|
@ -53,12 +53,14 @@ common_sources = files(
|
||||||
# Generated files #
|
# Generated files #
|
||||||
###################
|
###################
|
||||||
|
|
||||||
|
generated_sources = files()
|
||||||
|
|
||||||
# Debug
|
# Debug
|
||||||
debug_conf = configuration_data()
|
debug_conf = configuration_data()
|
||||||
debug_conf.set('BUGREPORT_URL', 'https://gitlab.gnome.org/GNOME/' + meson.project_name() + '/issues/new')
|
debug_conf.set('BUGREPORT_URL', 'https://gitlab.gnome.org/GNOME/' + meson.project_name() + '/issues/new')
|
||||||
debug_conf.set10('ENABLE_TRACING', enable_tracing)
|
debug_conf.set10('ENABLE_TRACING', enable_tracing)
|
||||||
|
|
||||||
common_sources += configure_file(
|
generated_sources += configure_file(
|
||||||
input : 'cc-debug.h.in',
|
input : 'cc-debug.h.in',
|
||||||
output : 'cc-debug.h',
|
output : 'cc-debug.h',
|
||||||
configuration : debug_conf
|
configuration : debug_conf
|
||||||
|
@ -71,13 +73,14 @@ resource_data = files(
|
||||||
'help-overlay.ui',
|
'help-overlay.ui',
|
||||||
)
|
)
|
||||||
|
|
||||||
common_sources += gnome.compile_resources(
|
generated_sources += gnome.compile_resources(
|
||||||
'resources',
|
'resources',
|
||||||
meson.project_name() + '.gresource.xml',
|
meson.project_name() + '.gresource.xml',
|
||||||
dependencies : resource_data,
|
dependencies : resource_data,
|
||||||
export : true
|
export : true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
common_sources += generated_sources
|
||||||
|
|
||||||
############
|
############
|
||||||
# libshell #
|
# libshell #
|
||||||
|
@ -92,6 +95,7 @@ libshell = static_library(
|
||||||
)
|
)
|
||||||
|
|
||||||
libshell_dep = declare_dependency(
|
libshell_dep = declare_dependency(
|
||||||
|
sources : generated_sources,
|
||||||
include_directories : top_inc,
|
include_directories : top_inc,
|
||||||
link_with : libshell
|
link_with : libshell
|
||||||
)
|
)
|
||||||
|
@ -159,6 +163,7 @@ libtestshell = static_library(
|
||||||
link_with : panels_libs,
|
link_with : panels_libs,
|
||||||
)
|
)
|
||||||
libtestshell_dep = declare_dependency(
|
libtestshell_dep = declare_dependency(
|
||||||
|
sources : generated_sources,
|
||||||
include_directories : top_inc,
|
include_directories : top_inc,
|
||||||
link_with : libtestshell
|
link_with : libtestshell
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,6 @@ test_units = [
|
||||||
'test-endianess',
|
'test-endianess',
|
||||||
]
|
]
|
||||||
|
|
||||||
includes = [top_inc, include_directories('../../panels/datetime')]
|
|
||||||
env = [
|
env = [
|
||||||
'G_MESSAGES_DEBUG=all',
|
'G_MESSAGES_DEBUG=all',
|
||||||
'BUILDDIR=' + meson.current_build_dir(),
|
'BUILDDIR=' + meson.current_build_dir(),
|
||||||
|
@ -22,9 +21,7 @@ foreach unit: test_units
|
||||||
exe = executable(
|
exe = executable(
|
||||||
unit,
|
unit,
|
||||||
[unit + '.c'],
|
[unit + '.c'],
|
||||||
include_directories : includes,
|
dependencies : common_deps + [m_dep, datetime_panel_lib_dep],
|
||||||
dependencies : common_deps + [m_dep],
|
|
||||||
link_with : [datetime_panel_lib],
|
|
||||||
c_args : cflags
|
c_args : cflags
|
||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue