Merge pull request #110863 from kisg/libgodot_migeran_core
LibGodot: Core - Build Godot Engine as a Library
This commit is contained in:
15
SConstruct
15
SConstruct
@ -264,6 +264,14 @@ opts.Add(
|
||||
True,
|
||||
)
|
||||
)
|
||||
opts.Add(
|
||||
EnumVariable(
|
||||
"library_type",
|
||||
"Build library type",
|
||||
"executable",
|
||||
("executable", "static_library", "shared_library"),
|
||||
)
|
||||
)
|
||||
|
||||
# Thirdparty libraries
|
||||
opts.Add(BoolVariable("builtin_brotli", "Use the built-in Brotli library", True))
|
||||
@ -546,6 +554,13 @@ if not env["deprecated"]:
|
||||
if env["precision"] == "double":
|
||||
env.Append(CPPDEFINES=["REAL_T_IS_DOUBLE"])
|
||||
|
||||
# Library Support
|
||||
if env["library_type"] != "executable":
|
||||
if "library" not in env.get("supported", []):
|
||||
print_error(f"Library builds unsupported for {env['platform']}")
|
||||
Exit(255)
|
||||
env.Append(CPPDEFINES=["LIBGODOT_ENABLED"])
|
||||
|
||||
# Default num_jobs to local cpu count if not user specified.
|
||||
# SCons has a peculiarity where user-specified options won't be overridden
|
||||
# by SetOption, so we can rely on this to know if we should use our default.
|
||||
|
||||
Reference in New Issue
Block a user