Compare commits
4 commits
35d721d1ed
...
6dd897a822
Author | SHA1 | Date | |
---|---|---|---|
rodolpheh | 6dd897a822 | ||
rodolpheh | 22250e6fec | ||
rodolpheh | 0c58581a5e | ||
rodolpheh | 71639b8dc9 |
36
SConstruct
36
SConstruct
|
@ -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"]),
|
||||
|
|
Loading…
Reference in a new issue