Force building embree with "generic" arch to avoid avx errors

When user passes ccflags="-march=native" or any other compiler cpu
target which supports avx we will get errors because embree is
compiled partially without AVX support but expects it to be present

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
This commit is contained in:
Yevhen Babiichuk (DustDFG) 2024-10-15 14:44:30 +03:00
parent af77100e39
commit c776189af9

View file

@ -68,7 +68,11 @@ if env["builtin_embree"]:
if not env.msvc:
if env["arch"] in ["x86_64", "x86_32"]:
env_raycast.Append(CCFLAGS=["-msse2", "-mxsave"])
# Force building embree with "generic" arch to avoid compilation errors with
# unresolved avx instruction support when user passes ccflags="-march=native"
# or any other compiler cpu target which supports avx
normalized = env["arch"].replace("_", "-")
env_raycast.Append(CCFLAGS=["-msse2", "-mxsave", "-march={}".format(normalized)])
if env["platform"] == "windows":
env_raycast.Append(CCFLAGS=["-mstackrealign"])