update SConstruct to be used from repo root and add --project option
This commit is contained in:
parent
32d74427e5
commit
6134d5130c
|
@ -2,6 +2,7 @@
|
||||||
demo/addons/
|
demo/addons/
|
||||||
demo/script_templates/
|
demo/script_templates/
|
||||||
icons/*.import
|
icons/*.import
|
||||||
|
godot-cpp
|
||||||
|
|
||||||
# Godot auto generated files
|
# Godot auto generated files
|
||||||
*.gen.*
|
*.gen.*
|
||||||
|
|
64
SConstruct
64
SConstruct
|
@ -2,6 +2,28 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# This is SConstruct file for building GDExtension variant using SCONS build system.
|
||||||
|
# For module variant, see SCsub file.
|
||||||
|
|
||||||
|
# For custom projects, you can customize output path for artifacts: scons --project=PATH_TO_YOUR_PROJECT
|
||||||
|
# - artifacts are placed into "addons/limboai/bin" subdirectory inside the project directory.
|
||||||
|
# - for example: scons --project="../my_project"
|
||||||
|
# - artifacts will be placed into "../my_project/addons/limboai/bin" relative to "limboai/" source dir.
|
||||||
|
# - if not specified, the artifacts will be places in the demo/ project.
|
||||||
|
# - For plugin to be loaded, create "addons/limboai/bin" directory in your project and copy limboai.gdextension file to it.
|
||||||
|
|
||||||
|
AddOption(
|
||||||
|
"--project",
|
||||||
|
dest="project",
|
||||||
|
type="string",
|
||||||
|
nargs=1,
|
||||||
|
action="store",
|
||||||
|
metavar="DIR",
|
||||||
|
default="demo",
|
||||||
|
help="Specify project directory.",
|
||||||
|
)
|
||||||
|
project_dir = GetOption("project")
|
||||||
|
|
||||||
env = SConscript("godot-cpp/SConstruct")
|
env = SConscript("godot-cpp/SConstruct")
|
||||||
|
|
||||||
# For reference:
|
# For reference:
|
||||||
|
@ -13,48 +35,44 @@ env = SConscript("godot-cpp/SConstruct")
|
||||||
# - LINKFLAGS are for linking flags
|
# - LINKFLAGS are for linking flags
|
||||||
|
|
||||||
# Generate version header.
|
# Generate version header.
|
||||||
sys.path.append("./limboai")
|
|
||||||
import limboai_version
|
import limboai_version
|
||||||
|
|
||||||
os.chdir("./limboai")
|
|
||||||
limboai_version.generate_module_version_header()
|
limboai_version.generate_module_version_header()
|
||||||
os.chdir("..")
|
|
||||||
sys.path.remove("./limboai")
|
|
||||||
|
|
||||||
# Tweak this if you want to use different folders, or more folders, to store your source code in.
|
# Tweak this if you want to use different folders, or more folders, to store your source code in.
|
||||||
env.Append(CPPPATH=["limboai/"])
|
|
||||||
env.Append(CPPDEFINES=["LIMBOAI_GDEXTENSION"])
|
env.Append(CPPDEFINES=["LIMBOAI_GDEXTENSION"])
|
||||||
sources = Glob("limboai/*.cpp")
|
sources = Glob("*.cpp")
|
||||||
sources += Glob("limboai/blackboard/*.cpp")
|
sources += Glob("blackboard/*.cpp")
|
||||||
sources += Glob("limboai/blackboard/bb_param/*.cpp")
|
sources += Glob("blackboard/bb_param/*.cpp")
|
||||||
sources += Glob("limboai/bt/*.cpp")
|
sources += Glob("bt/*.cpp")
|
||||||
sources += Glob("limboai/bt/tasks/*.cpp")
|
sources += Glob("bt/tasks/*.cpp")
|
||||||
sources += Glob("limboai/bt/tasks/blackboard/*.cpp")
|
sources += Glob("bt/tasks/blackboard/*.cpp")
|
||||||
sources += Glob("limboai/bt/tasks/composites/*.cpp")
|
sources += Glob("bt/tasks/composites/*.cpp")
|
||||||
sources += Glob("limboai/bt/tasks/decorators/*.cpp")
|
sources += Glob("bt/tasks/decorators/*.cpp")
|
||||||
sources += Glob("limboai/bt/tasks/scene/*.cpp")
|
sources += Glob("bt/tasks/scene/*.cpp")
|
||||||
sources += Glob("limboai/bt/tasks/utility/*.cpp")
|
sources += Glob("bt/tasks/utility/*.cpp")
|
||||||
sources += Glob("limboai/gdextension/*.cpp")
|
sources += Glob("gdextension/*.cpp")
|
||||||
sources += Glob("limboai/editor/debugger/*.cpp")
|
sources += Glob("editor/debugger/*.cpp")
|
||||||
sources += Glob("limboai/editor/*.cpp")
|
sources += Glob("editor/*.cpp")
|
||||||
sources += Glob("limboai/hsm/*.cpp")
|
sources += Glob("hsm/*.cpp")
|
||||||
sources += Glob("limboai/util/*.cpp")
|
sources += Glob("util/*.cpp")
|
||||||
|
|
||||||
# Generate documentation header.
|
# Generate documentation header.
|
||||||
if env["target"] in ["editor", "template_debug"]:
|
if env["target"] in ["editor", "template_debug"]:
|
||||||
doc_data = env.GodotCPPDocData("limboai/gen/doc_data.gen.cpp", source=Glob("limboai/doc_classes/*.xml"))
|
doc_data = env.GodotCPPDocData("gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml"))
|
||||||
sources.append(doc_data)
|
sources.append(doc_data)
|
||||||
|
|
||||||
if env["platform"] == "macos":
|
if env["platform"] == "macos":
|
||||||
library = env.SharedLibrary(
|
library = env.SharedLibrary(
|
||||||
"demo/addons/limboai/bin/liblimboai.{}.{}.framework/liblimboai.{}.{}".format(
|
project_dir
|
||||||
|
+ "/addons/limboai/bin/liblimboai.{}.{}.framework/liblimboai.{}.{}".format(
|
||||||
env["platform"], env["target"], env["platform"], env["target"]
|
env["platform"], env["target"], env["platform"], env["target"]
|
||||||
),
|
),
|
||||||
source=sources,
|
source=sources,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
library = env.SharedLibrary(
|
library = env.SharedLibrary(
|
||||||
"demo/addons/limboai/bin/liblimboai{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
|
project_dir + "/addons/limboai/bin/liblimboai{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
|
||||||
source=sources,
|
source=sources,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue