From f9e463bce2607c5136acc79ecd495f8b62b8e5ad Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 24 Sep 2017 23:06:45 -0400 Subject: Use EnumVariable for choice-based build options. --- platform/android/detect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'platform/android/detect.py') diff --git a/platform/android/detect.py b/platform/android/detect.py index c1ac54c587..6640a053fe 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -18,11 +18,12 @@ def can_build(): def get_opts(): + from SCons.Variables import EnumVariable return [ ('ANDROID_NDK_ROOT', 'Path to the Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)), ('ndk_platform', 'Target platform (android-, e.g. "android-18")', "android-18"), - ('android_arch', 'Target architecture (armv7/armv6/arm64v8/x86)', "armv7"), + EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86')), ('android_neon', 'Enable NEON support (armv7 only)', "yes"), ('android_stl', 'Enable Android STL support (for modules)', "no") ] -- cgit v1.2.3 From ffab67b8daea8e3379824105439eba8226b72fde Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 25 Sep 2017 00:04:49 -0400 Subject: Use BoolVariable in target/component/advanced options. --- platform/android/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/android/detect.py') diff --git a/platform/android/detect.py b/platform/android/detect.py index 6640a053fe..67b31e488b 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -32,7 +32,7 @@ def get_opts(): def get_flags(): return [ - ('tools', 'no'), + ('tools', False), ] -- cgit v1.2.3 From 5be675eb0332ccf660a81df51701146997ef9fcb Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 25 Sep 2017 00:27:32 -0400 Subject: Use BoolVariable for module options. --- platform/android/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/android/detect.py') diff --git a/platform/android/detect.py b/platform/android/detect.py index 67b31e488b..0a031fe0b1 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -244,7 +244,7 @@ def configure(env): env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z', 'dl']) # TODO: Move that to opus module's config - if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): + if 'module_opus_enabled' in env and env['module_opus_enabled']: if (env["android_arch"] == "armv6" or env["android_arch"] == "armv7"): env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) env.opus_fixed_point = "yes" -- cgit v1.2.3 From 3e69d19116e8d0d64fcbb096d925249e5d3596ed Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 25 Sep 2017 00:37:17 -0400 Subject: Use BoolVariable in platform-specific options. --- platform/android/detect.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'platform/android/detect.py') diff --git a/platform/android/detect.py b/platform/android/detect.py index 0a031fe0b1..13fc4ee810 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -18,14 +18,14 @@ def can_build(): def get_opts(): - from SCons.Variables import EnumVariable + from SCons.Variables import BoolVariable, EnumVariable return [ ('ANDROID_NDK_ROOT', 'Path to the Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)), ('ndk_platform', 'Target platform (android-, e.g. "android-18")', "android-18"), EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86')), - ('android_neon', 'Enable NEON support (armv7 only)', "yes"), - ('android_stl', 'Enable Android STL support (for modules)', "no") + BoolVariable('android_neon', 'Enable NEON support (armv7 only)', True), + BoolVariable('android_stl', 'Enable Android STL support (for modules)', False), ] @@ -94,7 +94,7 @@ def configure(env): env['android_arch'] = 'armv7' neon_text = "" - if env["android_arch"] == "armv7" and env['android_neon'] == 'yes': + if env["android_arch"] == "armv7" and env['android_neon']: neon_text = " (with NEON)" print("Building for Android (" + env['android_arch'] + ")" + neon_text) @@ -118,7 +118,7 @@ def configure(env): target_subpath = "arm-linux-androideabi-4.9" abi_subpath = "arm-linux-androideabi" arch_subpath = "armeabi-v7a" - if env['android_neon'] == 'yes': + if env['android_neon']: env.extra_suffix = ".armv7.neon" + env.extra_suffix else: env.extra_suffix = ".armv7" + env.extra_suffix @@ -200,7 +200,7 @@ def configure(env): elif env["android_arch"] == "armv7": target_opts = ['-target', 'armv7-none-linux-androideabi'] env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'.split()) - if env['android_neon'] == 'yes': + if env['android_neon']: env['neon_enabled'] = True env.Append(CPPFLAGS=['-mfpu=neon', '-D__ARM_NEON__']) else: @@ -214,7 +214,7 @@ def configure(env): env.Append(CPPFLAGS=target_opts) env.Append(CPPFLAGS=common_opts) - if (env['android_stl'] == 'yes'): + if env['android_stl']: env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/include"]) env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/" + arch_subpath + "/include"]) env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/" + arch_subpath]) -- cgit v1.2.3