summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2019-07-24 14:58:39 +0800
committerRobert Ancell <robert.ancell@gmail.com>2019-08-25 09:42:22 +0000
commit299647f970a5123e9f462327214c11ec758822d6 (patch)
treec06831f57994583b4e48a9c5c6f6600c40de58f4
parent6d16bf733739c6fd4e9ea99c6d8201fa3a214b04 (diff)
downloadgnome-control-center-299647f970a5123e9f462327214c11ec758822d6.tar.gz
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
-rw-r--r--panels/datetime/meson.build6
-rw-r--r--shell/meson.build9
-rw-r--r--tests/datetime/meson.build5
3 files changed, 14 insertions, 6 deletions
diff --git a/panels/datetime/meson.build b/panels/datetime/meson.build
index 64af3422e..2ed0da71e 100644
--- a/panels/datetime/meson.build
+++ b/panels/datetime/meson.build
@@ -192,5 +192,11 @@ datetime_panel_lib = static_library(
)
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('icons')
diff --git a/shell/meson.build b/shell/meson.build
index 1dc181f02..89b96590e 100644
--- a/shell/meson.build
+++ b/shell/meson.build
@@ -53,12 +53,14 @@ common_sources = files(
# Generated files #
###################
+generated_sources = 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(
+generated_sources += configure_file(
input : 'cc-debug.h.in',
output : 'cc-debug.h',
configuration : debug_conf
@@ -71,13 +73,14 @@ resource_data = files(
'help-overlay.ui',
)
-common_sources += gnome.compile_resources(
+generated_sources += gnome.compile_resources(
'resources',
meson.project_name() + '.gresource.xml',
dependencies : resource_data,
export : true
)
+common_sources += generated_sources
############
# libshell #
@@ -92,6 +95,7 @@ libshell = static_library(
)
libshell_dep = declare_dependency(
+ sources : generated_sources,
include_directories : top_inc,
link_with : libshell
)
@@ -159,6 +163,7 @@ libtestshell = static_library(
link_with : panels_libs,
)
libtestshell_dep = declare_dependency(
+ sources : generated_sources,
include_directories : top_inc,
link_with : libtestshell
)
diff --git a/tests/datetime/meson.build b/tests/datetime/meson.build
index 3e7a37851..c9f07877c 100644
--- a/tests/datetime/meson.build
+++ b/tests/datetime/meson.build
@@ -5,7 +5,6 @@ test_units = [
'test-endianess',
]
-includes = [top_inc, include_directories('../../panels/datetime')]
env = [
'G_MESSAGES_DEBUG=all',
'BUILDDIR=' + meson.current_build_dir(),
@@ -22,9 +21,7 @@ foreach unit: test_units
exe = executable(
unit,
[unit + '.c'],
- include_directories : includes,
- dependencies : common_deps + [m_dep],
- link_with : [datetime_panel_lib],
+ dependencies : common_deps + [m_dep, datetime_panel_lib_dep],
c_args : cflags
)
endforeach