Add Windows support to C demos (simple and instance_binding)

GLFW doesn't seem to work
This commit is contained in:
Aaron Franke
2021-04-21 00:05:29 -04:00
parent ddc3432c22
commit 706b352dfb
3 changed files with 32 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ if env["platform"] == "":
print("No valid target platform selected.")
quit()
env["target_path"] += env["platform"] + "/"
platform = env["platform"]
# Process other arguments.
if env["use_llvm"]:
@@ -76,9 +76,17 @@ elif env["platform"] == "windows":
# Make sure our library includes the Godot headers.
env.Append(CPPPATH=[".", godot_headers_path])
env["target_path"] += platform + "/"
# Make sure our library looks in the target path for any other
# libraries it may need. The path needs to be project-relative.
env.Append(LINKFLAGS=["-Wl,-rpath,gdnative/" + env["platform"]])
# We remove "project/" from the target path with "[8:]".
if platform == "windows":
env.Append(LINKFLAGS=["-LIBPATH:" + env["target_path"]])
else:
env.Append(LINKFLAGS=["-Wl,-rpath," + (env["target_path"])[8:]])
# The capital L path is used when compiling, so it includes "project/".
env.Append(LINKFLAGS=["-L" + env["target_path"]])
# Tweak this if you want to use different folders,
# or more folders, to store your source code in.