-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgodot-cpp.patch
More file actions
67 lines (55 loc) · 2.6 KB
/
godot-cpp.patch
File metadata and controls
67 lines (55 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
diff --git a/SConstruct b/SConstruct
index 8acea26..a37ac4a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -14,6 +14,13 @@ except Exception:
env.PrependENVPath("PATH", os.getenv("PATH"))
+# For windows compilation with nix
+platform_arg = ARGUMENTS.get("platform", None)
+if platform_arg == "windows":
+ env.Append(CPPPATH=[os.getenv("MCFGTHREADS_INCLUDE_DIR")])
+ env.Append(LIBPATH=[os.getenv("MCFGTHREADS_LIB_DIR"), os.getenv("MCFGTHREADS_DLL_DIR")])
+ env.Append(LIBS=['mcfgthread'])
+
# Custom options and profile flags.
customs = ["custom.py"]
try:
@@ -27,7 +34,7 @@ if profile:
elif os.path.isfile(profile + ".py"):
customs.append(profile + ".py")
opts = Variables(customs, ARGUMENTS)
-cpp_tool = Tool("godotcpp", toolpath=["tools"])
+cpp_tool = Tool("godotcpp", toolpath=[os.path.join(os.getenv("GODOT_CPP_SRC"), "tools")])
cpp_tool.options(opts, env)
opts.Update(env)
diff --git a/tools/godotcpp.py b/tools/godotcpp.py
index 3646264..905e24d 100644
--- a/tools/godotcpp.py
+++ b/tools/godotcpp.py
@@ -16,7 +16,7 @@ from doc_source_generator import scons_generate_doc_source
def add_sources(sources, dir, extension):
- for f in os.listdir(dir):
+ for f in os.listdir(os.path.join(os.getenv("GODOT_CPP_SRC"), dir)):
if f.endswith("." + extension):
sources.append(dir + "/" + f)
@@ -374,7 +374,7 @@ def options(opts, env):
# Add platform options (custom tools can override platforms)
for pl in sorted(set(platforms + custom_platforms)):
- tool = Tool(pl, toolpath=get_platform_tools_paths(env))
+ tool = Tool(pl, toolpath=[os.path.join(os.getenv("GODOT_CPP_SRC"), "tools")])
if hasattr(tool, "options"):
tool.options(opts)
@@ -440,7 +440,7 @@ def generate(env):
env["optimize"] = ARGUMENTS.get("optimize", opt_level)
env["debug_symbols"] = get_cmdline_bool("debug_symbols", env.dev_build)
- tool = Tool(env["platform"], toolpath=get_platform_tools_paths(env))
+ tool = Tool(env["platform"], toolpath=[os.path.join(os.getenv("GODOT_CPP_SRC"), "tools")])
if tool is None or not tool.exists(env):
raise ValueError("Required toolchain not found for platform " + env["platform"])
@@ -518,7 +518,7 @@ def generate(env):
def _godot_cpp(env):
- extension_dir = normalize_path(env.get("gdextension_dir", env.Dir("gdextension").abspath), env)
+ extension_dir = os.path.join(os.getenv("GODOT_CPP_SRC"), "gdextension")
api_file = normalize_path(env.get("custom_api_file", env.File(extension_dir + "/extension_api.json").abspath), env)
bindings = env.GodotCPPBindings(
env.Dir("."),