raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=5e59869a62f466b38929f78c5e150abe9b15daa3

commit 5e59869a62f466b38929f78c5e150abe9b15daa3
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Sat Aug 12 13:10:52 2017 +0900

    meson build - mixer - simplify for module build setup
    
    it's still complex anyway... :( but a little smaller
---
 src/modules/meson.build       |  16 ++++--
 src/modules/mixer/meson.build | 116 +++++++++++++++++++-----------------------
 2 files changed, 63 insertions(+), 69 deletions(-)

diff --git a/src/modules/meson.build b/src/modules/meson.build
index 56586fdff..8642d4206 100644
--- a/src/modules/meson.build
+++ b/src/modules/meson.build
@@ -4,7 +4,6 @@ module_includes  = [ '../../..', '../../bin', '../../bin/efx' ]
 module_includes2 = [ '../..'   , '../bin'   , '../bin/efx'  ]
 module_deps      = [ deps_e, dep_dl ]
 
-subdir('mixer')
 subdir('everything')
 
 mods = [
@@ -13,6 +12,7 @@ mods = [
   'pager',
   'pager_plain',
   'temperature',
+  'mixer',
   'notification',
   'ibox',
   'start',
@@ -82,9 +82,10 @@ foreach m: mods
   disable      = false
   cargs        = ''
   data         = []
+  deps         = []
+  inc          = []
   _dir         = join_paths(dir_module_e, m)
   _dir_bin     = join_paths(_dir, module_arch)
-  _inc         = include_directories(module_includes2, join_paths('.', m))
 
   subdir(m)
 
@@ -92,6 +93,13 @@ foreach m: mods
 
   if get_option(opt) == true and disable == false
 
+    _inc2 = []
+    foreach i: inc
+      _inc2 +=  join_paths('.', m, i)
+    endforeach
+    _inc          = include_directories(module_includes2,
+                                        join_paths('.', m),
+                                        _inc2)
     _conf         = 'USE_MODULE_' + m.underscorify().to_upper()
     module_files += join_paths(_dir_bin, m + '.so')
 
@@ -118,7 +126,7 @@ foreach m: mods
       shared_module(m, src,
                     include_directories: _inc,
                     name_prefix        : '',
-                    dependencies       : module_deps,
+                    dependencies       : [ module_deps, deps ],
                     install_dir        : _dir_bin,
                     install            : true
                    )
@@ -127,7 +135,7 @@ foreach m: mods
                     include_directories: _inc,
                     c_args             : cargs,
                     name_prefix        : '',
-                    dependencies       : module_deps,
+                    dependencies       : [ module_deps, deps ],
                     install_dir        : _dir_bin,
                     install            : true
                    )
diff --git a/src/modules/mixer/meson.build b/src/modules/mixer/meson.build
index e01d19a76..f611d6b48 100644
--- a/src/modules/mixer/meson.build
+++ b/src/modules/mixer/meson.build
@@ -1,73 +1,59 @@
-mixer_dist = [
-       'e-module-mixer.edj',
-       'module.desktop',
-]
+src = files(
+  'e_mod_main.c',
+  'e_mod_config.c',
+  'e_mod_config.h',
+  'e_mod_main.h',
+  'gadget/mixer.h',
+  'gadget/mixer.c',
+  'gadget/mod.c'
+ )
 
-mixer_src = [
-       'e_mod_config.c',
-       'e_mod_main.c',
-       'e_mod_config.h',
-       'e_mod_main.h',
-       'gadget/mixer.h',
-       'gadget/mixer.c',
-       'gadget/mod.c',
-]
+mixer_lib = files(
+  'lib/emix.c',
+  'lib/emix.h'
+ )
 
-mixer_lib = [
-       'lib/emix.c',
-       'lib/emix.h'
-]
+if get_option(m) == true
+  dep_alsa         = dependency('alsa', version: '>= 1.0.8', required: false)
+  dep_pulse        = dependency('libpulse', required: false)
+  dep_pulse_simple = dependency('libpulse-simple', required: false)
 
-mixer_dir = join_paths(dir_module_e, 'mixer', module_arch)
-if get_option('mixer') == true
-       config_h.set('USE_MODULE_MIXER', '1')
+  deps = [ dep_alsa, dep_pulse, dep_pulse_simple ]
+  inc = [ 'lib' ]
 
-       dep_alsa = dependency('alsa', version: '>= 1.0.8', required: false)
-       config_h.set('HAVE_ALSA', dep_alsa.found())
-       dep_pulse = dependency('libpulse', required: false)
-       dep_pulse_simple = dependency('libpulse-simple', required: false)
-       config_h.set('HAVE_PULSE', dep_pulse.found() and 
dep_pulse_simple.found())
-       if config_h.get('HAVE_ALSA') == true
-               mixer_lib += ['lib/backends/alsa/alsa.c']
-       endif
-       if config_h.get('HAVE_PULSE') == true
-               mixer_lib += [
-                       'lib/backends/pulseaudio/pulse_ml.c',
-                       'lib/backends/pulseaudio/pulse.c'
-               ]
-       endif
-       if config_h.has('HAVE_PULSE') == false and config_h.has('HAVE_ALSA') == 
false
-               error('mixer support requested, but no backends found!')
-       endif
+  config_h.set('HAVE_ALSA' , dep_alsa.found())
+  config_h.set('HAVE_PULSE', dep_pulse.found() and dep_pulse_simple.found())
 
-       install_data(mixer_dist,
-               install_dir: join_paths(dir_module_e, 'mixer')
-       )
-       install_data('emixer.desktop',
-               install_dir: join_paths(dir_data, 'applications')
-       )
-       install_data('emixer.png',
-               install_dir: join_paths(dir_data, 'pixmaps')
-       )
+  if config_h.get('HAVE_ALSA') == true
+    mixer_lib += files(
+      'lib/backends/alsa/alsa.c'
+    )
+  endif
+  if config_h.get('HAVE_PULSE') == true
+    mixer_lib += files(
+      'lib/backends/pulseaudio/pulse_ml.c',
+      'lib/backends/pulseaudio/pulse.c'
+    )
+  endif
+  if config_h.has('HAVE_PULSE') == false and config_h.has('HAVE_ALSA') == false
+    error('mixer support requested, but no backends found!')
+  endif
 
-        module_files += join_paths(mixer_dir, 'mixer.so')
-       shared_module('mixer',
-                mixer_src, mixer_lib,
-                include_directories: include_directories(module_includes, '.', 
'lib'),
-                name_prefix: '',
-                dependencies: [module_deps, dep_alsa, dep_pulse, 
dep_pulse_simple],
-                install_dir: mixer_dir,
-                install: true
-        )
+  src += mixer_lib
 
-       executable('emixer',
-               ['emixer.c', mixer_lib],
-               include_directories: include_directories(module_includes, '.', 
'lib'),
-               dependencies: [
-                       dep_elementary, dep_alsa, dep_pulse, dep_pulse_simple
-               ],
-               c_args: '-DEMIXER_BUILD',
-               install_dir: dir_bin,
-               install: true
-       )
+  install_data('emixer.desktop',
+               install_dir: join_paths(dir_data, 'applications')
+              )
+  install_data('emixer.png',
+               install_dir: join_paths(dir_data, 'pixmaps')
+              )
+
+  executable('emixer',
+             [ 'emixer.c', mixer_lib ],
+             include_directories: include_directories(module_includes, '.', 
'./lib'),
+             dependencies       : [ dep_elementary, deps ],
+             c_args             : '-DEMIXER_BUILD',
+             install_dir        : _dir_bin,
+             install            : true
+            )
 endif

-- 


Reply via email to