Browse Source

Merge pull request #26473 from akien-mga/scons-opus-fixed

SCons: Move platform-specific Opus config to its module
Rémi Verschelde 6 năm trước cách đây
mục cha
commit
2fa5bb6be7

+ 7 - 1
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)

+ 0 - 6
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:

+ 0 - 8
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"])

+ 0 - 4
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'