[gcab/wip/hughsie/subproject: 1/3] Allow compiling as a subproject



commit 821482f3371c212592515d23d0cf561fd0d9adff
Author: Richard Hughes <richard hughsie com>
Date:   Thu Nov 21 16:33:57 2019 +0000

    Allow compiling as a subproject
    
    This means we can compile gcab as a dep to projects like fwupd when the system
    version is missing or too old.

 libgcab/meson.build | 9 +++++++++
 meson.build         | 7 ++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/libgcab/meson.build b/libgcab/meson.build
index 7da6c9a..7d93125 100644
--- a/libgcab/meson.build
+++ b/libgcab/meson.build
@@ -56,6 +56,15 @@ libgcab = shared_library(
   install : true
 )
 
+gcab_dep = declare_dependency(
+  link_with : libgcab,
+  include_directories : [
+    include_directories('.'),
+    include_directories('..'),
+  ],
+  dependencies : gcab_deps
+)
+
 pkgg = import('pkgconfig')
 pkgg.generate(
   libraries : libgcab,
diff --git a/meson.build b/meson.build
index 547de63..4baf899 100644
--- a/meson.build
+++ b/meson.build
@@ -86,7 +86,7 @@ foreach arg: test_link_args
     global_link_args += arg
   endif
 endforeach
-add_global_link_arguments(
+add_project_link_arguments(
   global_link_args,
   language: 'c'
 )
@@ -94,6 +94,11 @@ add_global_link_arguments(
 gio = dependency('gio-2.0', version : '>= 2.44.0')
 libz = dependency('zlib')
 
+gcab_deps = [
+  gio,
+  libz,
+]
+
 gnome = import('gnome')
 i18n = import('i18n')
 


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