From 1807e0f1355efc92503aeb4c0a2496617d3f0872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 2 Mar 2019 10:30:10 +0100 Subject: [PATCH] SCons: Move platform-specific Opus config to its module --- modules/opus/SCsub | 8 +++++++- platform/android/detect.py | 6 ------ platform/iphone/detect.py | 8 -------- platform/javascript/detect.py | 4 ---- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/modules/opus/SCsub b/modules/opus/SCsub index cd5da75babf..aa656c575ae 100644 --- a/modules/opus/SCsub +++ b/modules/opus/SCsub @@ -138,7 +138,7 @@ if env['builtin_opus']: opus_sources_silk = [] - if("opus_fixed_point" in env and env.opus_fixed_point == "yes"): + if env["platform"] in ["android", "iphone", "javascript"]: env_opus.Append(CFLAGS=["-DFIXED_POINT"]) opus_sources_silk = [ "silk/fixed/LTP_analysis_filter_FIX.c", @@ -220,6 +220,12 @@ if env['builtin_opus']: ] env_opus.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) + if env["platform"] == "android" or env["platform"] == "iphone": + if ("arch" in env and env["arch"] == "arm") or ("android_arch" in env and env["android_arch"] in ["armv6", "armv7"]): + env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"]) + elif ("arch" in env and env["arch"] == "arm64") or ("android_arch" in env and env["android_arch"] == "arm64v8"): + env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"]) + env_thirdparty = env_opus.Clone() env_thirdparty.disable_warnings() env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) diff --git a/platform/android/detect.py b/platform/android/detect.py index aa482524351..80cda68a9e8 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -298,12 +298,6 @@ def configure(env): env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL']) 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']: - if (env["android_arch"] == "armv6" or env["android_arch"] == "armv7"): - env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) - env.opus_fixed_point = "yes" - # Return NDK version string in source.properties (adapted from the Chromium project). def get_ndk_version(path): if path is None: diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index d0e6a4cefe7..172572bcb45 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -174,11 +174,3 @@ def configure(env): env.Append(CPPPATH=['#platform/iphone']) env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES_ENABLED', '-DCOREAUDIO_ENABLED']) - - # TODO: Move that to opus module's config - if 'module_opus_enabled' in env and env['module_opus_enabled']: - env.opus_fixed_point = "yes" - if (env["arch"] == "arm"): - env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) - elif (env["arch"] == "arm64"): - env.Append(CFLAGS=["-DOPUS_ARM64_OPT"]) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 3cc79097f8d..47da8de5df6 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -136,7 +136,3 @@ def configure(env): # TODO: Reevaluate usage of this setting now that engine.js manages engine runtime. env.Append(LINKFLAGS=['-s', 'NO_EXIT_RUNTIME=1']) - - # TODO: Move that to opus module's config. - if 'module_opus_enabled' in env and env['module_opus_enabled']: - env.opus_fixed_point = 'yes'