Skip to content

Commit

Permalink
Merge pull request #26473 from akien-mga/scons-opus-fixed
Browse files Browse the repository at this point in the history
SCons: Move platform-specific Opus config to its module
  • Loading branch information
akien-mga authored Mar 2, 2019
2 parents e930fb9 + 1807e0f commit 2fa5bb6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
8 changes: 7 additions & 1 deletion modules/opus/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions platform/android/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,6 @@ def mySpawn(sh, escape, cmd, args, 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:
Expand Down
8 changes: 0 additions & 8 deletions platform/iphone/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
4 changes: 0 additions & 4 deletions platform/javascript/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 2fa5bb6

Please sign in to comment.