meson: modify options for enabling the bindings 10/197410/1
authorWonki Kim <wonki_.kim@samsung.com>
Wed, 9 Jan 2019 14:36:09 +0000 (14:36 +0000)
committerWonki Kim <wonki_.kim@samsung.com>
Fri, 11 Jan 2019 05:18:42 +0000 (14:18 +0900)
bindings are added as subdir by foreaching a array defined in meson.build at root.
then meson checks a option which has the same name of the binding.
this patch appends a new option for selecting bindings to build.

[howto]
*as-is
meson build.asis/ -Dmono=false -Dcxx=true
ninja -C build.asis/

*to-be
menson build.tobe/ -Dbindings=luajit,cxx
ninja -C build.tobe/

it is imposibble to use this wrongly because meson raise a error if arguments are not in a predefined list that described in meson_options.txt.
for more information, refer to https://mesonbuild.com/Build-options.html and also take a look at meson_options.txt please.
Differential Revision: https://phab.enlightenment.org/D7563

Change-Id: I5fa0af9ecf9b76a15a40f2822f6f34c5e4602c3b
Signed-off-by: Wonki Kim <wonki_.kim@samsung.com>
.ci/ci-configure.sh
meson.build
meson_options.txt

index b2a62b5..4a2211b 100755 (executable)
@@ -7,7 +7,7 @@ set -e
 if [ "$BUILDSYSTEM" = "ninja" ] ; then
   if [ "$DISTRO" != "" ] ; then
     # Normal build test of all targets
-    OPTS=" -Decore-imf-loaders-disabler=scim,ibus -Davahi=false -Dmono=false -Dcxx=false"
+    OPTS=" -Decore-imf-loaders-disabler=scim,ibus -Davahi=false -Dbindings=luajit"
 
     WAYLAND_LINUX_COPTS=" -Dwl=true -Ddrm=true -Dopengl=es-egl"
 
@@ -41,7 +41,7 @@ if [ "$BUILDSYSTEM" = "ninja" ] ; then
     export CFLAGS="-I/usr/local/opt/openssl/include -frewrite-includes $CFLAGS"
     export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
     export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
-    mkdir build && meson build -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Dmono=false -Dcxx=false -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Demotion-loaders-disabler=gstreamer,gstreamer1,libvlc,xine
+    mkdir build && meson build -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Dbindings=luajit -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Demotion-loaders-disabler=gstreamer,gstreamer1,libvlc,xine
   fi
 else
   CI_BUILD_TYPE="$1"
index cee0c1b..5299ad2 100644 (file)
@@ -406,12 +406,10 @@ subdir(join_paths('src', 'generic', 'evas'))
 subdir(join_paths('src', 'generic', 'emotion'))
 subdir('cmakeconfig')
 
-bindings = ['luajit', 'cxx', 'mono']
+bindings = get_option('bindings')
 
 foreach binding : bindings
-  if get_option(binding)
-    subdir(join_paths('src', 'bindings', binding))
-  endif
+  subdir(join_paths('src', 'bindings', binding))
 endforeach
 
 subdir(join_paths('src', 'edje_external'))
index 713ac13..c925037 100644 (file)
@@ -310,22 +310,11 @@ option('nls',
   description: 'enable localization: (default=true)'
 )
 
-option('luajit',
-  type: 'boolean',
-  value: true,
-  description: 'Flag for handling lua bindings'
-)
-
-option('cxx',
-  type: 'boolean',
-  value: true,
-  description: 'Flag for handling cxx bindings'
-)
-
-option('mono',
-  type: 'boolean',
-  value: false,
-  description: 'Flag for handling c# bindings'
+option('bindings',
+  type : 'array',
+  choices : ['luajit', 'cxx', 'mono'],
+  value : ['luajit', 'cxx'],
+  description : 'Add values here to enable the bindings',
 )
 
 option('native-arch-optimization',