[gegl] build: code cleanup - remove trailing whitespace - remove unnecessary brackets - tidy up dependency



commit b5421d4063a34232ca1c06de3de7d8347fc5121c
Author: John Marshall <jtm home gmail com>
Date:   Sun Jul 12 10:28:06 2020 +0100

    build: code cleanup
    - remove trailing whitespace
    - remove unnecessary brackets
    - tidy up dependency checking for clarity

 gegl/meson.build                |   6 +--
 meson.build                     | 106 +++++++++++++++++++++-------------------
 meson_options.txt               |   4 +-
 operations/workshop/meson.build |  32 ++++++------
 4 files changed, 78 insertions(+), 70 deletions(-)
---
diff --git a/gegl/meson.build b/gegl/meson.build
index 9d8f26e5a..b68aeb6fe 100644
--- a/gegl/meson.build
+++ b/gegl/meson.build
@@ -91,7 +91,7 @@ gegl_ldflags = os_osx ? ['-framework', 'OpenCL'] : []
 
 gegl_lib = library(api_name,
   gegl_sources,
-  include_directories: [ rootInclude, geglInclude, ],
+  include_directories: [rootInclude, geglInclude],
   dependencies: [
     babl,
     glib,
@@ -99,8 +99,8 @@ gegl_lib = library(api_name,
     math,
     gmodule,
   ],
-  c_args: [ gegl_cflags, ],
-  link_args: [ gegl_ldflags, ],
+  c_args: gegl_cflags,
+  link_args: gegl_ldflags,
   install: true,
   version: so_version,
 )
diff --git a/meson.build b/meson.build
index 52c0e0908..d582d565d 100644
--- a/meson.build
+++ b/meson.build
@@ -103,16 +103,14 @@ cflags_common = []
 cflags_c      = []
 cflags_cpp    = []
 
-cflags_common += [
-  '-DHAVE_CONFIG_H',
-]
+cflags_common += '-DHAVE_CONFIG_H'
 
 if buildtype == 'debugoptimized' or buildtype == 'release'
-  cflags_common += ['-Ofast']
+  cflags_common += '-Ofast'
 endif
 
 if buildtype == 'debugoptimized' or buildtype == 'debug'
-  cflags_common += ['-DGEGL_ENABLE_DEBUG']
+  cflags_common += '-DGEGL_ENABLE_DEBUG'
 endif
 
 cflags_common += [
@@ -127,7 +125,7 @@ cflags_c = [
 ]
 
 if os_win32
-  cflags_common += [ '-D_FILE_OFFSET_BITS=64' ]
+  cflags_common += '-D_FILE_OFFSET_BITS=64'
 endif
 
 cflags_c   = cflags_common + cflags_c
@@ -175,18 +173,18 @@ json_glib = dependency('json-glib-1.0', version: '>=1.2.6')
 # Required libraries eventually provided in subprojects/ subdir
 
 poly2tri_c= dependency('poly2tri-c',  version: '>=0.0.0',
-  fallback: [ 'poly2tri-c', 'poly2tri_c' ],
+  fallback: ['poly2tri-c', 'poly2tri_c'],
   required: false,
 )
 
 libnsgif = dependency('libnsgif',
-  fallback: [ 'libnsgif', 'libnsgif' ],
+  fallback: ['libnsgif', 'libnsgif'],
 )
 
 ################################################################################
 # Optionnal Dependencies
 
-# gobject introspection
+# GEGL library
 if get_option('introspection') != 'false'
   g_ir = dependency('gobject-introspection-1.0', version: '>=1.32.0',
     required: get_option('introspection') == 'true' ? true : false,
@@ -194,22 +192,44 @@ if get_option('introspection') != 'false'
 else
   g_ir = disabler()
 endif
+if g_ir.found()
+  vapigen = dependency('vapigen',     version:'>=0.20.0',
+    required: get_option('vapigen')
+  )
+else
+  vapigen = disabler()
+endif
+
+# GEGL binary
+gexiv2    = dependency('gexiv2',      version: '>=0.0.0',
+  required: get_option('gexiv2')
+)
+config.set('HAVE_GEXIV2', gexiv2.found())
+libpng    = dependency('libpng',      version: '>=1.6.0',
+  required: get_option('libpng')
+)
+lua       = dependency('luajit',      version: '>=2.0.4',
+  required: get_option('lua')
+)
+config.set('HAVE_LUA', lua.found())
+mrg       = dependency('mrg',         version: '>=0.0.0',
+  required: get_option('mrg')
+)
+config.set('HAVE_MRG', mrg.found())
+
+# Operations
 gdk_pixbuf= dependency('gdk-pixbuf-2.0', version:'>=2.32.0',
   required: get_option('gdk-pixbuf')
 )
+cairo     = dependency('cairo',       version: '>=1.12.2',
+  required: get_option('cairo')
+)
 pango     = dependency('pango',       version: '>=1.38.0',
   required: get_option('pango')
 )
 pangocairo= dependency('pangocairo',  version: '>=1.38.0',
   required: get_option('pangocairo')
 )
-cairo     = dependency('cairo',       version: '>=1.12.2',
-  required: get_option('cairo')
-)
-gexiv2    = dependency('gexiv2',      version: '>=0.0.0',
-  required: get_option('gexiv2')
-)
-config.set('HAVE_GEXIV2', gexiv2.found())
 
 jasper    = dependency('jasper',      version: '>=1.900.1',
   required: get_option('jasper')
@@ -223,9 +243,6 @@ lensfun   = dependency('lensfun',     version: '>=0.2.5',
 libjpeg   = dependency('libjpeg',     version: '>=1.0.0',
   required: get_option('libjpeg')
 )
-libpng    = dependency('libpng',      version: '>=1.6.0',
-  required: get_option('libpng')
-)
 libraw    = dependency('libraw',      version: '>=0.15.4',
   required: get_option('libraw')
 )
@@ -244,47 +261,26 @@ libv4l1   = dependency('libv4l1',     version: '>=1.0.1',
 libv4l2   = dependency('libv4l2',     version: '>=1.0.1',
   required: get_option('libv4l2')
 )
-lua       = dependency('luajit',      version: '>=2.0.4',
-  required: get_option('lua')
-)
-config.set('HAVE_LUA', lua.found())
-mrg       = dependency('mrg',         version: '>=0.1.4',
-  required: get_option('mrg')
+libwebp   = dependency('libwebp',     version:'>=0.5.0',
+  required: get_option('webp')
 )
-config.set('HAVE_MRG', mrg.found())
-
 maxflow   = dependency('maxflow',     version: '>=3.0.4',
   required: get_option('maxflow')
 )
 openexr   = dependency('OpenEXR',     version: '>=1.6.1',
   required: get_option('openexr')
 )
+poppler = dependency('poppler-glib', version: '>=0.71.0',
+  required: get_option('poppler')
+)
 sdl1      = dependency('sdl',         version: '>=1.2.0',
   required: get_option('sdl1')
 )
 sdl2      = dependency('sdl2',        version: '>=2.0.5',
   required: get_option('sdl2')
 )
-if g_ir.found()
-  vapigen = dependency('vapigen',     version:'>=0.20.0',
-    required: get_option('vapigen')
-  )
-else
-  vapigen = disabler()
-endif
-libwebp   = dependency('libwebp',     version:'>=0.5.0',
-  required: get_option('webp')
-)
-poppler = dependency('poppler-glib', version: '>=0.71.0',
-  required: get_option('poppler')
-)
-if g_ir.found()
-  pygobject3 = dependency('pygobject-3.0', version: '>=3.2.0',
-    required: get_option('pygobject')
-  )
-else
-  pygobject3 = disabler()
-endif
+
+# AV libs
 libavcodec  = dependency('libavcodec',   version: '>=55.69.100',
   required: get_option('libav')
 )
@@ -303,8 +299,9 @@ avlibs_found = (
   libavutil.found() and
   libswscale.found()
 )
-avlibs = avlibs_found ? [ libavcodec, libavformat, libavutil, libswscale ] : []
+avlibs = avlibs_found ? [libavcodec, libavformat, libavutil, libswscale] : []
 
+# libumfpack
 libumfpack = cc.find_library('umfpack', required: get_option('umfpack'))
 if libumfpack.found()
   have_umfpack = cc.has_header('umfpack.h')
@@ -324,6 +321,15 @@ if libumfpack.found()
   config.set('HAVE_SUITESPARSE_UMFPACK_H', have_ss_umfpack)
 endif
 
+# Tests
+if g_ir.found()
+  pygobject3 = dependency('pygobject-3.0', version: '>=3.2.0',
+    required: get_option('pygobject')
+  )
+else
+  pygobject3 = disabler()
+endif
+
 ################################################################################
 # Subdirs
 
@@ -363,7 +369,6 @@ pkgconfig.generate(filebase: 'gegl-' + api_version,
     gmodule,
     gio,
     json_glib,
-
     babl,
   ],
   libraries: [
@@ -400,7 +405,7 @@ summary(
     'rsvg-convert'    : rsvg_convert.found(),
     'Ruby'            : ruby.found(),
   }, section: 'Optional build utilities'
-) 
+)
 summary(
   {
     'avlibs'          : avlibs_found,
@@ -413,6 +418,7 @@ summary(
     'libnsgif'        : libnsgif.found(),
     'libraw'          : libraw.found(),
     'Luajit'          : lua.found(),
+    'maxflow'         : maxflow.found(),
     'mrg'             : mrg.found(),
     'Pango'           : pango.found(),
     'pangocairo'      : pangocairo.found(),
diff --git a/meson_options.txt b/meson_options.txt
index 0b25c1fd9..54d2df00e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -22,7 +22,6 @@ option('vapigen',
 )
 
 # optional dependencies
-option('exiv2',         type: 'feature', value: 'auto')
 option('gdk-pixbuf',    type: 'feature', value: 'auto')
 option('gexiv2',        type: 'feature', value: 'auto')
 option('graphviz',      type: 'feature', value: 'auto')
@@ -51,3 +50,6 @@ option('sdl1',          type: 'feature', value: 'disabled')
 option('sdl2',          type: 'feature', value: 'auto')
 option('umfpack',       type: 'feature', value: 'auto')
 option('webp',          type: 'feature', value: 'auto')
+
+# obsolete - no effect
+option('exiv2',         type: 'feature', value: 'disabled')
diff --git a/operations/workshop/meson.build b/operations/workshop/meson.build
index a1324cfad..d4ca128e7 100644
--- a/operations/workshop/meson.build
+++ b/operations/workshop/meson.build
@@ -2,22 +2,22 @@ subdir('external')
 subdir('generated')
 
 gegl_workshop_sources = files(
-  'aces-rrt.c', 
-  'alpha-inpaint.c', 
-  'bilateral-filter-fast.c', 
-  'boxblur-1d.c', 
-  'boxblur.c', 
-  'connected-components.c', 
-  'demosaic-bimedian.c', 
-  'demosaic-simple.c', 
-  'ditto.c', 
-  'band-tune.c', 
-  'gcr.c', 
-  'gradient-map.c', 
-  'integral-image.c', 
-  'rawbayer-load.c', 
-  'segment-kmeans.c', 
-  'selective-hue-saturation.c', 
+  'aces-rrt.c',
+  'alpha-inpaint.c',
+  'bilateral-filter-fast.c',
+  'boxblur-1d.c',
+  'boxblur.c',
+  'connected-components.c',
+  'demosaic-bimedian.c',
+  'demosaic-simple.c',
+  'ditto.c',
+  'band-tune.c',
+  'gcr.c',
+  'gradient-map.c',
+  'integral-image.c',
+  'rawbayer-load.c',
+  'segment-kmeans.c',
+  'selective-hue-saturation.c',
 )
 
 gegl_workshop_sources += custom_target('module_workshop.c',


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