From e4644495117eb85d0c7840ea499506e4a11e973c Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 11 Aug 2017 20:44:38 +0900 Subject: [PATCH] meson build - simplify 3 more wl modules to use generic parent harness this makes wl_text_input wl_desktop_shell and wl_weekeyboard use the generic build, add to the src list the generated files --- src/modules/meson.build | 26 ++++++---- src/modules/wl_desktop_shell/meson.build | 48 ++++--------------- src/modules/wl_text_input/meson.build | 39 +++++---------- src/modules/wl_weekeyboard/meson.build | 60 ++++++++---------------- 4 files changed, 57 insertions(+), 116 deletions(-) diff --git a/src/modules/meson.build b/src/modules/meson.build index 7861e6a74..4e79305c8 100644 --- a/src/modules/meson.build +++ b/src/modules/meson.build @@ -8,9 +8,6 @@ subdir('wizard') subdir('mixer') subdir('everything') subdir('teamwork') -subdir('wl_desktop_shell') -subdir('wl_text_input') -subdir('wl_weekeyboard') # disabled for now ####subdir('wl_fb') @@ -72,6 +69,9 @@ mods = [ 'wl_wl', 'wl_buffer', 'wl_drm', + 'wl_text_input', + 'wl_desktop_shell', + 'wl_weekeyboard', 'xwayland' ] @@ -80,9 +80,11 @@ foreach m: mods no_icon = false disable = false cargs = '' + data = [] _dir = join_paths(dir_module_e, m) _dir_bin = join_paths(_dir, module_arch) _inc = include_directories(module_includes2, join_paths('.', m)) + subdir(m) opt = '-'.join(m.split('_')) @@ -93,14 +95,20 @@ foreach m: mods module_files += join_paths(_dir_bin, m + '.so') if desktop_only == true - install_data([ join_paths(m, 'module.desktop') - ], - install_dir: _dir) + _data = [ join_paths(m, 'module.desktop') ] elif no_icon == true + _data = [] else - install_data([ join_paths(m, 'e-module-' + m + '.edj'), - join_paths(m, 'module.desktop') - ], + _data = [ join_paths(m, 'e-module-' + m + '.edj'), + join_paths(m, 'module.desktop') ] + endif + + foreach d: data + _data += join_paths(m, d) + endforeach + + if _data.length() > 0 + install_data(_data, install_dir: _dir) endif diff --git a/src/modules/wl_desktop_shell/meson.build b/src/modules/wl_desktop_shell/meson.build index ec70b022d..88cb7175e 100644 --- a/src/modules/wl_desktop_shell/meson.build +++ b/src/modules/wl_desktop_shell/meson.build @@ -1,46 +1,16 @@ -module = 'wl_desktop_shell' -opt = 'wl-desktop-shell' -conf = 'USE_MODULE_WL_DESKTOP_SHELL' - -src = [ +src = files( 'e_mod_main.c', 'e_mod_input_panel.c', 'wl_shell.c', 'xdg5.c', 'xdg6.c', 'e_mod_main.h' +) +foreach p: [ + '@0@/unstable/xdg-shell/xdg-shell-unstable-v5.xml'.format(dir_wayland_protocols), + '@0@/unstable/xdg-shell/xdg-shell-unstable-v6.xml'.format(dir_wayland_protocols), + '@0@/unstable/input-method/input-method-unstable-v1.xml'.format(dir_wayland_protocols), ] - -icon = [ - 'e-module-' + module + '.edj', - 'module.desktop' -] - -dir_mod = join_paths(dir_module_e, module) -dir_mod_bin = join_paths(dir_mod, module_arch) - -if get_option(opt) == true and get_option('wayland') == true - config_h.set(conf, '1') - module_files += join_paths(dir_mod_bin, module + '.so') - - install_data(icon, install_dir: dir_mod) - - protos = [ - '@0@/unstable/xdg-shell/xdg-shell-unstable-v5.xml'.format(dir_wayland_protocols), - '@0@/unstable/xdg-shell/xdg-shell-unstable-v6.xml'.format(dir_wayland_protocols), - '@0@/unstable/input-method/input-method-unstable-v1.xml'.format(dir_wayland_protocols), - ] - foreach proto: protos - src += gen_scanner_server.process(proto) - src += gen_scanner_impl.process(proto) - endforeach - - shared_module(module, src, - include_directories: include_directories(module_includes), - name_prefix : '', - dependencies : module_deps, - install_dir : dir_mod_bin, - install : true - ) -endif - + src += gen_scanner_server.process(p) + src += gen_scanner_impl.process(p) +endforeach diff --git a/src/modules/wl_text_input/meson.build b/src/modules/wl_text_input/meson.build index 7178bf577..3ee2ecf16 100644 --- a/src/modules/wl_text_input/meson.build +++ b/src/modules/wl_text_input/meson.build @@ -1,30 +1,13 @@ -wl_text_input_src = [ - 'e_mod_main.c', +src = files( + 'e_mod_main.c' +) + +foreach p: [ + '@0@/unstable/input-method/input-method-unstable-v1.xml'.format(dir_wayland_protocols), + '@0@/unstable/text-input/text-input-unstable-v1.xml'.format(dir_wayland_protocols) ] + src += gen_scanner_server.process(p) + src += gen_scanner_impl.process(p) +endforeach - -wl_text_input_dir = join_paths(dir_module_e, 'wl_text_input', module_arch) -if get_option('wl-text-input') == true and get_option('wayland') == true - config_h.set('USE_MODULE_WL_TEXT_INPUT', '1') - - protos = [ - '@0@/unstable/input-method/input-method-unstable-v1.xml'.format(dir_wayland_protocols), - '@0@/unstable/text-input/text-input-unstable-v1.xml'.format(dir_wayland_protocols), - ] - - foreach proto: protos - wl_text_input_src += gen_scanner_server.process(proto) - wl_text_input_src += gen_scanner_impl.process(proto) - endforeach - - module_files += join_paths(wl_text_input_dir, 'wl_text_input.so') - shared_module('wl_text_input', - wl_text_input_src, - include_directories: include_directories(module_includes), - name_prefix: '', - dependencies: module_deps, - install_dir: wl_text_input_dir, - install: true - ) -endif - +no_icon = true diff --git a/src/modules/wl_weekeyboard/meson.build b/src/modules/wl_weekeyboard/meson.build index 032f8d0cf..3fe5d7b71 100644 --- a/src/modules/wl_weekeyboard/meson.build +++ b/src/modules/wl_weekeyboard/meson.build @@ -1,42 +1,22 @@ -wl_weekeyboard_dist = [ - 'themes/default/default_600.edj', - 'themes/default/default_720.edj', - 'themes/default/default_1080.edj' +src = files( + 'e_mod_main.c', + 'wkb-log.c', + 'wkb-log.h' +) + +foreach p: [ + '@0@/unstable/input-method/input-method-unstable-v1.xml'.format(dir_wayland_protocols), + '@0@/unstable/text-input/text-input-unstable-v1.xml'.format(dir_wayland_protocols), +] + src += gen_scanner_server.process(p) + src += gen_scanner_client.process(p) + src += gen_scanner_impl.process(p) +endforeach + +data = [ + 'themes/default/default_600.edj', + 'themes/default/default_720.edj', + 'themes/default/default_1080.edj' ] -wl_weekeyboard_src = [ - 'e_mod_main.c', - 'wkb-log.c', - 'wkb-log.h', -] - -wl_weekeyboard_dir = join_paths(dir_module_e, 'wl_weekeyboard', module_arch) -if get_option('wl-weekeyboard') == true and get_option('wayland') == true - config_h.set('USE_MODULE_WL_WEEKEYBOARD', '1') - - protos = [ - '@0@/unstable/input-method/input-method-unstable-v1.xml'.format(dir_wayland_protocols), - '@0@/unstable/text-input/text-input-unstable-v1.xml'.format(dir_wayland_protocols), - ] - - foreach proto: protos - wl_weekeyboard_src += gen_scanner_server.process(proto) - wl_weekeyboard_src += gen_scanner_client.process(proto) - wl_weekeyboard_src += gen_scanner_impl.process(proto) - endforeach - - install_data(wl_weekeyboard_dist, - install_dir: join_paths(dir_module_e, 'wl_weekeyboard') - ) - - module_files += join_paths(wl_weekeyboard_dir, 'wl_weekeyboard.so') - shared_module('wl_weekeyboard', - wl_weekeyboard_src, - include_directories: include_directories(module_includes), - name_prefix: '', - dependencies: module_deps, - install_dir: wl_weekeyboard_dir, - install: true - ) -endif - +no_icon = true