[libgd/wip/meson] meson: Provide dependency_object



commit ed1fa19f864558c385023f1a7fbcb7e463a5880c
Author: Zeeshan Ali <zeenix gmail com>
Date:   Tue Oct 11 16:14:02 2016 +0200

    meson: Provide dependency_object
    
    Make it easy for projects to use libgd as subproject (when it's possible).

 meson.build |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1ad1b12..b32ab98 100644
--- a/meson.build
+++ b/meson.build
@@ -101,10 +101,12 @@ endif
 add_global_arguments('-I' + meson.source_root(), language: 'c')
 add_global_arguments('-I' + meson.source_root() + '/libgd', language: 'c')
 
+libgd = shared_library('gd', sources, dependencies: [gtk, libm])
 if get_option('libgd-static')
-    static_library('gd', sources, dependencies: [gtk, libm])
+    libgd_lib = static_library('gd', sources, dependencies: [gtk, libm])
+else
+    libgd_lib = libgd
 endif
-libgd = shared_library('gd', sources, dependencies: [gtk, libm])
 
 if get_option('libgd-gir') or get_option('libgd-vapi')
     gnome = import('gnome')
@@ -127,3 +129,10 @@ if get_option('libgd-gir') or get_option('libgd-vapi')
                              install: false)
     endif
 endif
+
+include = include_directories(meson.source_root())
+
+# If you use libgd as meson subproject in your project, you'll want to make use
+# of libgd_dep variable
+libgd_dep = declare_dependency(link_with: libgd_lib,
+                               include_directories: include)


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