[glibmm/glibmm-2-66] Meson build: examples and tests: Add dependency('threads')
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-66] Meson build: examples and tests: Add dependency('threads')
- Date: Sat, 13 Mar 2021 09:50:51 +0000 (UTC)
commit b030714ebc3cc8a314002122986d1fedaedcff1d
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Sat Mar 13 10:47:55 2021 +0100
Meson build: examples and tests: Add dependency('threads')
Multithreaded examples and tests depend on 'threads'.
I noticed this when I started experimenting with subprojects.
Strange that the linker did not report it as an error long ago.
examples/meson.build | 6 +++++-
tests/meson.build | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/examples/meson.build b/examples/meson.build
index a4ba9cf2..499d6f6e 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -30,6 +30,7 @@ if not is_host_windows
]
endif
+thread_dep = dependency('threads')
# import('gnome').compile_schemas() can't be use here.
# It can only compile schemas in the current directory.
@@ -63,9 +64,12 @@ foreach ex : examples
endif
endforeach
+ is_multithread = ex[0][0] == 'network' or ex[0][0] == 'thread'
+ mm_dep = ex[3] ? giomm_dep : glibmm_dep
+
executable(ex_name, ex_sources,
cpp_args: ['-DGLIBMM_DISABLE_DEPRECATED', '-DGIOMM_DISABLE_DEPRECATED'],
- dependencies: ex[3] ? giomm_dep : glibmm_dep,
+ dependencies: is_multithread ? [mm_dep, thread_dep] : mm_dep,
gui_app: false,
build_by_default: build_examples,
install: false,
diff --git a/tests/meson.build b/tests/meson.build
index 4b7c5de1..4a31c95d 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -40,6 +40,8 @@ test_programs = [
[['glibmm_weakref'], 'test', ['main.cc'], true],
]
+thread_dep = dependency('threads')
+
foreach ex : test_programs
dir = ''
foreach dir_part : ex[0]
@@ -51,9 +53,12 @@ foreach ex : test_programs
ex_sources += dir / src
endforeach
+ is_multithread = ex[0][0] == 'glibmm_mainloop'
+ mm_dep = ex[3] ? giomm_dep : glibmm_dep
+
exe_file = executable(ex_name, ex_sources,
cpp_args: ['-DGLIBMM_DISABLE_DEPRECATED', '-DGIOMM_DISABLE_DEPRECATED'],
- dependencies: ex[3] ? giomm_dep : glibmm_dep,
+ dependencies: is_multithread ? [mm_dep, thread_dep] : mm_dep,
gui_app: false,
build_by_default: true,
install: false,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]