SCons: Move platform-specific Opus config to its module

This commit is contained in:
Rémi Verschelde
2019-03-02 10:30:10 +01:00
parent e930fb9a6e
commit 1807e0f135
4 changed files with 7 additions and 19 deletions

View File

@@ -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)