[libgit2-glib] meson: Fix internal `libgit2_glib_dep` dependency



commit 4c71fee10f4fb350349c61d15251336d6d02feb4
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Mon Nov 12 15:36:21 2018 +0100

    meson: Fix internal `libgit2_glib_dep` dependency
    
    `libgit2_glib_dep` only exposes the list of headers used along with
    `libgit2_glib` shared library. These libraries are located in the
    `libgit2-glib` directory, so this should be the only shared
    directory.
    
    Tests and examples use this dependency that also includes the top
    source directory. However the top source directory include must be
    added independently.

 examples/meson.build     | 2 +-
 libgit2-glib/meson.build | 8 +++-----
 tests/meson.build        | 2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/examples/meson.build b/examples/meson.build
index e5e8d92..fc1024d 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -12,6 +12,6 @@ foreach example: examples
     example,
     example + '.c',
     dependencies: libgit2_glib_dep,
-    include_directories: libgit2_glib_inc,
+    include_directories: top_inc,
   )
 endforeach
diff --git a/libgit2-glib/meson.build b/libgit2-glib/meson.build
index 70afd42..3a9ec68 100644
--- a/libgit2-glib/meson.build
+++ b/libgit2-glib/meson.build
@@ -1,5 +1,3 @@
-libgit2_glib_inc = include_directories('.')
-
 headers = [
   'ggit-annotated-commit.h',
   'ggit-blame.h',
@@ -239,11 +237,11 @@ pkg.generate(
 
 # Internal dependency, for tests and benchmarks
 libgit2_glib_dep = declare_dependency(
-  link_with: libgit2_glib,
-  include_directories: [top_inc, libgit2_glib_inc],
-  dependencies: platform_deps,
   # Everything that uses libgit2-glib needs this built to compile
   sources: enum_sources[1],
+  include_directories: include_directories('.'),
+  dependencies: platform_deps,
+  link_with: libgit2_glib,
 )
 
 if enable_python
diff --git a/tests/meson.build b/tests/meson.build
index f5ccd07..38f3fb1 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -5,7 +5,7 @@ foreach unit: unit_tests
     unit,
     unit + '.c',
     dependencies: libgit2_glib_dep,
-    include_directories: libgit2_glib_inc,
+    include_directories: top_inc,
   )
 
   test(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]