diff options
Diffstat (limited to 'platform/linuxbsd/detect.py')
-rw-r--r-- | platform/linuxbsd/detect.py | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index 54351757cd..72bffceb1f 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -10,10 +10,6 @@ if TYPE_CHECKING: from SCons import Environment -def is_active(): - return True - - def get_name(): return "LinuxBSD" @@ -56,6 +52,16 @@ def get_opts(): ] +def get_doc_classes(): + return [ + "EditorExportPlatformLinuxBSD", + ] + + +def get_doc_path(): + return "doc_classes" + + def get_flags(): return [ ("arch", detect_arch()), @@ -100,7 +106,7 @@ def configure(env: "Environment"): print("Using linker program: " + env["linker"]) if env["linker"] == "mold" and using_gcc(env): # GCC < 12.1 doesn't support -fuse-ld=mold. cc_version = get_compiler_version(env) - cc_semver = (int(cc_version["major"]), int(cc_version["minor"])) + cc_semver = (cc_version["major"], cc_version["minor"]) if cc_semver < (12, 1): found_wrapper = False for path in ["/usr/libexec", "/usr/local/libexec", "/usr/lib", "/usr/local/lib"]: @@ -229,11 +235,15 @@ def configure(env: "Environment"): env.ParseConfig("pkg-config libenet --cflags --libs") if not env["builtin_squish"]: - env.ParseConfig("pkg-config libsquish --cflags --libs") + # libsquish doesn't reliably install its .pc file, so some distros lack it. + env.Append(LIBS=["libsquish"]) if not env["builtin_zstd"]: env.ParseConfig("pkg-config libzstd --cflags --libs") + if env["brotli"] and not env["builtin_brotli"]: + env.ParseConfig("pkg-config libbrotlicommon libbrotlidec --cflags --libs") + # Sound and video libraries # Keep the order as it triggers chained dependencies (ogg needed by others, etc.) @@ -281,6 +291,9 @@ def configure(env: "Environment"): # No pkgconfig file so far, hardcode expected lib name. env.Append(LIBS=["embree3"]) + if not env["builtin_openxr"]: + env.ParseConfig("pkg-config openxr --cflags --libs") + if env["fontconfig"]: if not env["use_sowrap"]: if os.system("pkg-config --exists fontconfig") == 0: # 0 means found @@ -442,7 +455,7 @@ def configure(env: "Environment"): linker_version_str = subprocess.check_output( [env.subst(env["LINK"]), "-Wl,--version"] + env.subst(env["LINKFLAGS"]) ).decode("utf-8") - gnu_ld_version = re.search("^GNU ld [^$]*(\d+\.\d+)$", linker_version_str, re.MULTILINE) + gnu_ld_version = re.search(r"^GNU ld [^$]*(\d+\.\d+)$", linker_version_str, re.MULTILINE) if not gnu_ld_version: print( "Warning: Creating export template binaries enabled for PCK embedding is currently only supported with GNU ld, not gold, LLD or mold." @@ -453,6 +466,9 @@ def configure(env: "Environment"): else: env.Append(LINKFLAGS=["-T", "platform/linuxbsd/pck_embed.legacy.ld"]) + 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 |