summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/detect.py
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linuxbsd/detect.py')
-rw-r--r--platform/linuxbsd/detect.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 72bffceb1f..eaaaad82b9 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -85,6 +85,16 @@ def configure(env: "Environment"):
# gdb works fine without it though, so maybe our crash handler could too.
env.Append(LINKFLAGS=["-rdynamic"])
+ # Cross-compilation
+ # TODO: Support cross-compilation on architectures other than x86.
+ host_is_64_bit = sys.maxsize > 2**32
+ if host_is_64_bit and env["arch"] == "x86_32":
+ env.Append(CCFLAGS=["-m32"])
+ env.Append(LINKFLAGS=["-m32"])
+ elif not host_is_64_bit and env["arch"] == "x86_64":
+ env.Append(CCFLAGS=["-m64"])
+ env.Append(LINKFLAGS=["-m64"])
+
# CPU architecture flags.
if env["arch"] == "rv64":
# G = General-purpose extensions, C = Compression extension (very common).
@@ -424,7 +434,7 @@ def configure(env: "Environment"):
env.Append(CPPDEFINES=["X11_ENABLED"])
if env["vulkan"]:
- env.Append(CPPDEFINES=["VULKAN_ENABLED"])
+ env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
if not env["use_volk"]:
env.ParseConfig("pkg-config vulkan --cflags --libs")
if not env["builtin_glslang"]:
@@ -469,22 +479,11 @@ def configure(env: "Environment"):
if platform.system() == "FreeBSD":
env.Append(LINKFLAGS=["-lkvm"])
- ## Cross-compilation
- # TODO: Support cross-compilation on architectures other than x86.
- host_is_64_bit = sys.maxsize > 2**32
- if host_is_64_bit and env["arch"] == "x86_32":
- env.Append(CCFLAGS=["-m32"])
- env.Append(LINKFLAGS=["-m32", "-L/usr/lib/i386-linux-gnu"])
- elif not host_is_64_bit and env["arch"] == "x86_64":
- env.Append(CCFLAGS=["-m64"])
- env.Append(LINKFLAGS=["-m64", "-L/usr/lib/i686-linux-gnu"])
-
# Link those statically for portability
if env["use_static_cpp"]:
env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"])
if env["use_llvm"] and platform.system() != "FreeBSD":
env["LINKCOM"] = env["LINKCOM"] + " -l:libatomic.a"
-
else:
if env["use_llvm"] and platform.system() != "FreeBSD":
env.Append(LIBS=["atomic"])