[gtk/gtk-3-24-meson] meson: simplify builtin_immodules build option



commit 55a699132664b1451fcb981d8ff8f9a4e38ee95d
Author: Christoph Reiter <creiter src gnome org>
Date:   Fri Apr 5 07:48:56 2019 +0200

    meson: simplify builtin_immodules build option
    
    Make it a yes/no/auto combo. "yes" means all modules are built into libgtk,
    "no" that none are and "auto" uses the platform defaults, yes on win32,
    no otherwise.
    
    If we need more we can always extend it later.

 gtk/meson.build           |  2 +-
 meson.build               | 30 ++++++------------------------
 meson_options.txt         |  4 ++--
 modules/input/meson.build |  2 +-
 4 files changed, 10 insertions(+), 28 deletions(-)
---
diff --git a/gtk/meson.build b/gtk/meson.build
index 06f3c943bc..e1b1a268ec 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -951,7 +951,7 @@ foreach l: immodules
   cond = l.get(2, true)
   cflags = l.get(3, [])
 
-  if cond and (builtin_immodules.contains(name) or builtin_all_immodules)
+  if cond and builtin_immodules
     mod = static_library('staticimmodule-@0@'.format(name),
                          sources + gtk_dep_sources,
                          dependencies: gtk_deps + [libgdk_dep] ,
diff --git a/meson.build b/meson.build
index 3411e3a046..538abb378c 100644
--- a/meson.build
+++ b/meson.build
@@ -468,8 +468,6 @@ else
   cdata.set_quoted('ISO_CODES_PREFIX', get_option('prefix'))
 endif
 
-backend_immodules = []
-
 pc_gdk_extra_libs = []
 
 cairo_found_type = cairo_dep.type_name()
@@ -525,7 +523,6 @@ if wayland_enabled
   wlprotocolsdep = dependency('wayland-protocols', version: wayland_proto_req)
   wlcursordep    = dependency('wayland-cursor', version: wayland_req)
   wlegldep       = dependency('wayland-egl')
-  backend_immodules += ['wayland']
 
   wayland_pkgs = [
     'wayland-client', wayland_req,
@@ -551,8 +548,6 @@ if x11_enabled
   fontconfig_dep = dependency('fontconfig', fallback: ['fontconfig', 'fontconfig_dep'])
   atkbridge_dep  = dependency('atk-bridge-2.0', version: atk_req)
 
-  backend_immodules += ['xim']
-
   x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr']
 
   if xcursor_dep.found()
@@ -623,12 +618,10 @@ endif
 
 if broadway_enabled
   pc_gdk_extra_libs += ['-lz']
-  backend_immodules += ['broadway']
 endif
 
 if quartz_enabled
   pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon', '-framework CoreGraphics']
-  backend_immodules += ['quartz']
 endif
 
 extra_demo_ldflags = []
@@ -643,7 +636,6 @@ if win32_enabled
     pc_gdk_extra_libs += ['-Wl,-luuid']
   endif
   pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32']
-  backend_immodules += ['ime']
 
 # Check whether libepoxy is built with EGL support on Windows
   win32_has_egl = cc.links(
@@ -662,30 +654,20 @@ endif
 
 # IMModules stuff-unfortunately we need to put items here
 # as they can be built as modules or built directly into GTK
-builtin_all_immodules = false
-
 builtin_modules_opt = get_option('builtin_immodules')
-builtin_immodules = []
-
-if builtin_modules_opt == ''
+if builtin_modules_opt == 'auto'
   if os_win32
     # Current MSVC projects build all immodules directly into GTK by default,
     # as does the mingw autotools build
     message('IMModules are built into GTK for MSVC builds by default')
-    builtin_immodules = ['all']
+    builtin_immodules = true
   else
-    builtin_immodules = ['none']
+    builtin_immodules = false
   endif
+elif builtin_modules_opt == 'yes'
+  builtin_immodules = true
 else
-  builtin_immodules = builtin_modules_opt.split(',')
-endif
-
-if builtin_immodules.contains('none')
-  builtin_immodules = []
-elif builtin_immodules.contains('all')
-  builtin_all_immodules = true
-elif builtin_immodules.contains('backend')
-  builtin_immodules += backend_immodules
+  builtin_immodules = false
 endif
 
 proto_sources = [
diff --git a/meson_options.txt b/meson_options.txt
index 7a0e7aa592..5b30c29aa6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -39,5 +39,5 @@ option('tests', type: 'boolean', value: 'true',
   description : 'Build tests')
 
 # input modules
-option('builtin_immodules', type: 'string',
-       value: '', description: 'Build specified immodules into GTK so/DLL (comma-separated list), "all", 
"none" or "backend"')
+option('builtin_immodules', type: 'combo', choices : ['yes', 'no', 'auto'],
+       value: 'auto', description: 'Build immodules into GTK so/DLL')
diff --git a/modules/input/meson.build b/modules/input/meson.build
index 0e8ea9ec2c..09625a93c1 100644
--- a/modules/input/meson.build
+++ b/modules/input/meson.build
@@ -7,7 +7,7 @@ foreach l: immodules
   cond = l.get(2, true)
   cflags = l.get(3, [])
 
-  if cond and not (builtin_immodules.contains(name) or builtin_all_immodules)
+  if cond and not builtin_immodules
     shared_module('im-@0@'.format(name),
                   immod_sources,
                   c_args: common_cflags + cflags,


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