build: Prefer dependencies instead of link_with

Meson uses the 'dependencies' field to determine and
parallelize build steps, but that isn't entirely true
with 'link_with'; this might cause a race condition
when generating header files while trying to build
them.

Fix that by only using 'dependencies' instead of 'link_with'.
This commit is contained in:
Georges Basile Stavracas Neto 2018-11-06 17:50:24 -02:00
parent d3dc7d6f49
commit d1c4c46281
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385
8 changed files with 33 additions and 19 deletions

View File

@ -13,8 +13,10 @@ libmutter_cogl_gles2 = shared_library('mutter-cogl-gles2-' + libmutter_api_versi
c_args: cogl_c_args,
include_directories: [cogl_includepath, cogl_path_includepath],
link_depends: 'libmutter-cogl-gles2.map',
dependencies: [cogl_deps],
link_with: libmutter_cogl,
dependencies: [
cogl_deps,
libmutter_cogl_dep
],
install_rpath: pkglibdir,
install_dir: pkglibdir,
install: true,

View File

@ -18,6 +18,7 @@ cogl_pango_deps = [
cogl_deps,
pango_dep,
pangocairo_dep,
libmutter_cogl_dep,
]
libmutter_cogl_pango = shared_library('mutter-cogl-pango-' + libmutter_api_version,
@ -25,13 +26,16 @@ libmutter_cogl_pango = shared_library('mutter-cogl-pango-' + libmutter_api_versi
c_args: cogl_c_args,
include_directories: [cogl_includepath, cogl_path_includepath],
link_depends: 'libmutter-cogl-pango.map',
dependencies: cogl_pango_deps,
link_with: libmutter_cogl,
dependencies: [cogl_pango_deps],
install_rpath: pkglibdir,
install_dir: pkglibdir,
install: true,
)
libmutter_cogl_pango_dep = declare_dependency(
link_with: libmutter_cogl_pango,
)
if have_introspection
libmutter_cogl_pango_gir = gnome.generate_gir(libmutter_cogl_pango,
sources: cogl_pango_public_headers,
@ -44,8 +48,11 @@ if have_introspection
'Pango-1.0',
'PangoCairo-1.0'
],
dependencies: [cogl_deps, pango_dep],
link_with: [libmutter_cogl, libmutter_cogl_pango],
dependencies: [
cogl_deps,
pango_dep,
libmutter_cogl_pango_dep,
],
extra_args: [
'-UCOGL_COMPILATION',
'-DG_LOG_DOMAIN=\"CoglPango\"',

View File

@ -54,8 +54,7 @@ libmutter_cogl_path = shared_library('mutter-cogl-path-' + libmutter_api_version
c_args: cogl_c_args,
include_directories: [cogl_includepath, cogl_path_includepath],
link_depends: 'libmutter-cogl-path.map',
dependencies: [cogl_deps],
link_with: libmutter_cogl,
dependencies: [libmutter_cogl_dep, cogl_deps],
install_rpath: pkglibdir,
install_dir: pkglibdir,
install: true,

View File

@ -80,10 +80,10 @@ libmutter_cogl_test_conformance = executable('test-conformance',
include_directories: cogl_test_conformance_includes,
dependencies: [
cogl_deps,
libmutter_cogl_dep,
libmutter_cogl_path_dep,
libmutter_cogl_test_fixtures_dep
libmutter_cogl_test_fixtures_dep,
],
link_with: [libmutter_cogl],
install: false,
)

View File

@ -9,7 +9,9 @@ cogl_test_journal = executable('test-journal',
'-DTESTS_DATADIR="@0@"'.format(join_paths(cogl_srcdir, 'tests/data')),
],
include_directories: cogl_includepath,
dependencies: cogl_deps,
link_with: [libmutter_cogl],
dependencies: [
cogl_deps,
libmutter_cogl_dep,
],
install: false,
)

View File

@ -15,8 +15,12 @@ libmutter_cogl_test_unit = executable('test-unit',
'-DTESTS_DATADIR="@0@/tests/data"'.format(cogl_srcdir),
],
include_directories: cogl_test_unit_includes,
dependencies: [cogl_deps, libmutter_cogl_test_fixtures_dep],
link_with: [libmutter_cogl, libmutter_cogl_path],
dependencies: [
cogl_deps,
libmutter_cogl_dep,
libmutter_cogl_path_dep,
libmutter_cogl_test_fixtures_dep,
],
install: false,
)

View File

@ -782,8 +782,10 @@ if have_introspection
libmutter_cogl_pango_gir[0],
libmutter_clutter_gir[0],
],
dependencies: [mutter_deps],
link_with: [libmutter],
dependencies: [
mutter_deps,
libmutter_dep,
],
extra_args: mutter_c_args + [
'-U_GNU_SOURCE',
],

View File

@ -5,6 +5,7 @@ tests_c_args = mutter_c_args
tests_deps = [
mutter_deps,
libmutter_dep,
libmutter_cogl_dep,
libmutter_clutter_dep,
]
@ -34,7 +35,6 @@ test_runner = executable('mutter-test-runner',
],
include_directories: tests_includepath,
c_args: tests_c_args,
link_with: [libmutter],
dependencies: [tests_deps],
install: false,
)
@ -61,7 +61,6 @@ unit_tests = executable('mutter-test-unit-tests',
],
include_directories: tests_includepath,
c_args: tests_c_args,
link_with: [libmutter],
dependencies: [tests_deps],
install: false,
)
@ -78,7 +77,6 @@ headless_start_test = executable('mutter-headless-start-test',
],
include_directories: tests_includepath,
c_args: tests_c_args,
link_with: [libmutter],
dependencies: [tests_deps],
install: false,
)