Compare commits

...

4 commits

Author SHA1 Message Date
rodolpheh 6dd897a822 Add Windows build too 2023-10-26 21:46:27 +01:00
rodolpheh 22250e6fec Add missing import 2023-10-26 21:13:13 +01:00
rodolpheh 0c58581a5e Add changes to build on Mac 2023-10-26 19:35:45 +01:00
rodolpheh 71639b8dc9 Add missing LIBS and LIBPATH 2023-10-25 17:43:38 +01:00

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
import sys
import subprocess
env = SConscript("godot-cpp/SConstruct")
@ -17,12 +18,41 @@ env.Append(CPPPATH=["src/"])
sources = Glob("src/*.cpp")
if env["platform"] == "macos":
target = "demo/addons/godot_ultraleap_plugin/bin/libgdultraleap.{}.{}.framework/libgdultraleap.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
)
library = env.SharedLibrary(
"demo/addons/godot_ultraleap_plugin/bin/libgdultraleap.{}.{}.framework/libgdultraleap.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
),
target,
source=sources,
)
env.Append(LIBS=['LeapC'])
env.Append(LIBPATH = ["/Applications/Ultraleap Hand Tracking Service.app/Contents/LeapSDK/lib"])
env.Append(CPPPATH = ["/Applications/Ultraleap Hand Tracking Service.app/Contents/LeapSDK/include"])
def sys_exec(args):
proc = subprocess.Popen(args, stdout=subprocess.PIPE, text=True)
(out, err) = proc.communicate()
return out.rstrip("\r\n").lstrip()
def change_rpath(self, arg, env, executor = None):
sys_exec(["install_name_tool", "-change", "@rpath/%s" % "libLeapC.5.dylib", "@loader_path/../%s" % "libLeapC.5.dylib", target])
change_rpath_action = Action('', change_rpath)
AddPostAction(library, change_rpath_action)
elif env["platform"] == "windows":
library = env.SharedLibrary(
"demo/addons/godot_ultraleap_plugin/bin/libgdultraleap{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
env.Append(LIBS=['LeapC'])
env.Append(LIBPATH = ['C:/Program Files/Ultraleap/LeapSDK/lib/x64'])
elif env["platform"] == "android":
print("Android is not supported yet")
exit(1)
else:
library = env.SharedLibrary(
"demo/addons/godot_ultraleap_plugin/bin/libgdultraleap{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),