[gimp/wip/nielsdg/meson-internal-cleanup: 1/2] meson: Declare internal libgimp(ui) dependency



commit 904a2e422d1570248218b0e7c7e1dbdd15c7ecf4
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Mon May 11 06:34:31 2020 +0200

    meson: Declare internal libgimp(ui) dependency
    
    By using Meson's `declare_dependency()`, we can avoid specifying the
    linked libraries, dependencies and includes we need over and over again.
    
    Basically, this conceptually acts like an internal pkg-config.

 libgimp/meson.build | 45 ++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 38 insertions(+), 7 deletions(-)
---
diff --git a/libgimp/meson.build b/libgimp/meson.build
index 272578ec40..155438e7f2 100644
--- a/libgimp/meson.build
+++ b/libgimp/meson.build
@@ -291,7 +291,10 @@ libgimp = library('gimp-'+ gimp_api_version,
   libgimp_sources,
   include_directories: rootInclude,
   dependencies: [
-    gegl, gexiv2, gtk3, drmingw,
+    gegl,
+    gexiv2,
+    drmingw,
+    gtk3,
   ],
   c_args: [ '-DG_LOG_DOMAIN="LibGimp"', '-DGIMP_COMPILATION', ],
   link_with: [
@@ -304,19 +307,33 @@ libgimp = library('gimp-'+ gimp_api_version,
   version: so_version,
 )
 
-
-libgimpui = library('gimpui-'+ gimp_api_version,
-  libgimpui_sources,
-  include_directories: rootInclude,
+# Define an internal dependency for ease of reuse
+libgimp_dep = declare_dependency(
   dependencies: [
-    gegl, gexiv2, gtk3,
+    cairo,
+    gdk_pixbuf,
+    gegl,
   ],
-  c_args: [ '-DG_LOG_DOMAIN="LibGimpUI"', '-DGIMP_COMPILATION', ],
   link_with: [
     libgimp,
     libgimpbase,
     libgimpcolor,
     libgimpconfig,
+    libgimpmath,
+  ],
+  include_directories: rootInclude,
+)
+
+
+libgimpui = library('gimpui-'+ gimp_api_version,
+  libgimpui_sources,
+  dependencies: [
+    libgimp_dep,
+    gexiv2,
+    gtk3,
+  ],
+  c_args: [ '-DG_LOG_DOMAIN="LibGimpUI"', '-DGIMP_COMPILATION', ],
+  link_with: [
     libgimpmodule,
     libgimpwidgets,
   ],
@@ -325,6 +342,20 @@ libgimpui = library('gimpui-'+ gimp_api_version,
   version: so_version,
 )
 
+# Define an internal dependency for ease of reuse
+libgimpui_dep = declare_dependency(
+  dependencies: [
+    libgimp_dep,
+    gtk3,
+  ],
+  link_with: [
+    libgimpmodule,
+    libgimpui,
+    libgimpwidgets,
+  ],
+  include_directories: rootInclude,
+)
+
 
 install_headers(
   libgimp_headers,


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