[retro-gtk] build: Use the appropriate dependency object
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] build: Use the appropriate dependency object
- Date: Mon, 4 Dec 2017 06:35:34 +0000 (UTC)
commit 0baccfec6be13f1bc06d804e927893272ca14075
Author: Adrien Plazas <kekun plazas laposte net>
Date: Mon Dec 4 07:34:50 2017 +0100
build: Use the appropriate dependency object
Instead of using `link_with` for internal targets, we should create a
dependency object for the libmanette shared library.
Not only this is the idiomatic form for internal dependencies in Meson,
but it also allows us to transitively depend on the library
dependencies, and to specify the inclusion path for the library itself,
thus avoiding the add_project_arguments() call using the build root
directory. This allows us to use libmanette as a subproject in other
Meson-based projects.
demos/meson.build | 3 +--
meson.build | 4 ----
retro-gtk/meson.build | 8 ++++++++
3 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/demos/meson.build b/demos/meson.build
index 7db27a2..075373d 100644
--- a/demos/meson.build
+++ b/demos/meson.build
@@ -6,8 +6,7 @@ executable(
'retro-demo',
'retro-demo.c',
c_args: retro_demo_c_args,
- dependencies: retro_gtk_deps,
- link_with: retro_gtk_lib,
+ dependencies: retro_gtk_dep,
include_directories: [ confinc, srcinc ],
gui_app: true,
install: true,
diff --git a/meson.build b/meson.build
index 916a538..b5b3d32 100644
--- a/meson.build
+++ b/meson.build
@@ -33,9 +33,5 @@ configure_file(
configuration: config_h,
)
-add_project_arguments([
- '-I' + meson.build_root(),
-], language: 'c')
-
subdir('retro-gtk')
subdir('demos')
diff --git a/retro-gtk/meson.build b/retro-gtk/meson.build
index 00e9486..6f5ec69 100644
--- a/retro-gtk/meson.build
+++ b/retro-gtk/meson.build
@@ -104,6 +104,7 @@ retro_gtk_lib = shared_library(
retro_gtk_sources,
c_args: retro_gtk_c_args,
dependencies: retro_gtk_deps,
+ include_directories: confinc,
install: true,
)
@@ -150,6 +151,13 @@ gnome.generate_vapi(
sources: retro_gtk_gir[0],
)
+retro_gtk_dep = declare_dependency(
+ link_with: retro_gtk_lib,
+ sources: retro_gtk_gir,
+ include_directories: confinc,
+ dependencies: retro_gtk_deps,
+)
+
install_headers(retro_gtk_headers, subdir: 'retro-gtk')
pkg = import('pkgconfig')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]