Automatically disable Fast Noise 2 on non-x86 targets

This commit is contained in:
Aaron Franke 2022-08-28 01:00:34 -05:00
parent a3468710d3
commit 2712184a57
2 changed files with 11 additions and 9 deletions

18
SCsub
View File

@ -1,8 +1,10 @@
Import('env') Import("env")
Import('env_modules') Import("env_modules")
# Note, support for FastNoise2 requires C++17, and doesn't work yet on ARM. # Note, support for FastNoise2 requires C++17, and only works on x86.
FAST_NOISE_2_SRC = env["voxel_fast_noise_2"] FAST_NOISE_2_SRC = env["voxel_fast_noise_2"]
if not env["arch"].startswith("x86"):
FAST_NOISE_2_SRC = False
RUN_TESTS = env["voxel_tests"] RUN_TESTS = env["voxel_tests"]
@ -107,7 +109,7 @@ if FAST_NOISE_2_SRC:
env_voxel.Append(CXXFLAGS=["-Wno-unknown-pragmas"]) env_voxel.Append(CXXFLAGS=["-Wno-unknown-pragmas"])
# Build from source. Should be the simplest, but requires C++17 # Build from source. Should be the simplest, but requires C++17
SConscript('thirdparty/fast_noise_2/SConscript', exports = ["env", "env_voxel"]) SConscript("thirdparty/fast_noise_2/SConscript", exports = ["env", "env_voxel"])
env_voxel.Append(CPPPATH=["thirdparty/fast_noise_2/include"]) env_voxel.Append(CPPPATH=["thirdparty/fast_noise_2/include"])
@ -128,12 +130,12 @@ for f in voxel_files:
# TODO Check webassembly builds (`env["platform"] == "javascript"`) # TODO Check webassembly builds (`env["platform"] == "javascript"`)
# Ignored clang warnings because Godot's codebase is old and isn't using override yet # Ignored clang warnings because Godot's codebase is old and isn't using override yet
if env['platform'] in ['osx', 'android']: if env["platform"] in ["osx", "android"]:
env_voxel.Append(CXXFLAGS=['-Wno-inconsistent-missing-override']) env_voxel.Append(CXXFLAGS=["-Wno-inconsistent-missing-override"])
# Doesn't work, since the rest of Godot doesn't use this, linking fails. # Doesn't work, since the rest of Godot doesn't use this, linking fails.
# No safe STL boundary checks for you. # No safe STL boundary checks for you.
#if env['target'] == 'debug': #if env["target"] == "debug":
# if env.msvc: # if env.msvc:
# # Enable STL bound checks, Godot's master environment doesn't do it # # Enable STL bound checks, Godot's master environment doesn't do it
# env_voxel.Append(CXXFLAGS=['/D_DEBUG']) # env_voxel.Append(CXXFLAGS=["/D_DEBUG"])

View File

@ -11,7 +11,7 @@ def configure(env):
env_vars.Add(BoolVariable("voxel_tests", env_vars.Add(BoolVariable("voxel_tests",
"Build with tests for the voxel module, which will run on startup of the engine", False)) "Build with tests for the voxel module, which will run on startup of the engine", False))
env_vars.Add(BoolVariable("voxel_fast_noise_2", "Build FastNoise2 support", True)) env_vars.Add(BoolVariable("voxel_fast_noise_2", "Build FastNoise2 support (x86-only)", True))
env_vars.Update(env) env_vars.Update(env)
Help(env_vars.GenerateHelpText(env)) Help(env_vars.GenerateHelpText(env))