Add post-action copy dll for Windows

This commit is contained in:
rodolpheh 2023-11-06 20:35:49 +00:00
parent 0c50394a66
commit d5ed6a0d32
2 changed files with 17 additions and 7 deletions

View File

@ -16,6 +16,8 @@ env = SConscript("godot-cpp/SConstruct")
# tweak this if you want to use different folders, or more folders, to store your source code in.
env.Append(CPPPATH=["src/"])
sources = Glob("src/*.cpp")
post_actions = []
library = None
if env["platform"] == "macos":
target = "demo/addons/godot_ultraleap_plugin/bin/libgdultraleap.{}.{}.framework/libgdultraleap.{}.{}".format(
@ -51,6 +53,10 @@ elif env["platform"] == "windows":
env.Append(LIBS=['LeapC'])
env.Append(LIBPATH = ['C:/Program Files/Ultraleap/LeapSDK/lib/x64'])
env.Append(CPPPATH = ["C:/Program Files/Ultraleap/LeapSDK/include"])
post_actions = [
Copy("demo/addons/godot_ultraleap_plugin/bin/LeapC.dll", "C:/Program Files/Ultraleap/LeapSDK/lib/x64/LeapC.dll")
]
elif env["platform"] == "android":
library = env.SharedLibrary(
"demo/addons/godot_ultraleap_plugin/bin/libgdultraleap{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
@ -69,9 +75,6 @@ elif env["platform"] == "android":
Copy("demo/android/plugins/ultraleap_binder/ultraleap-binder-debug.aar", "godot-ultraleap-binder/ultraleap-binder/build/outputs/aar/ultraleap-binder-debug.aar"),
Copy("demo/addons/godot_ultraleap_plugin/bin/libLeapC.so", "android/libLeapC.so")
]
for post_action in post_actions:
AddPostAction(library, post_action)
else:
library = env.SharedLibrary(
"demo/addons/godot_ultraleap_plugin/bin/libgdultraleap{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
@ -80,4 +83,10 @@ else:
env.Append(LIBS=['LeapC'])
env.Append(LIBPATH = ['/usr/lib/ultraleap-hand-tracking-service'])
Default(library)
if library is not None:
for post_action in post_actions:
AddPostAction(library, post_action)
Default(library)
else:
print("Nothing to build, weird")

View File

@ -16,6 +16,7 @@ android.release.arm64 = "bin/libgdultraleap.android.template_release.arm64.so"
[dependencies]
android.debug.arm64 = {
"bin/libLeapC.so": ""
}
android.debug.arm64 = { "bin/libLeapC.so": "" }
android.release.arm64 = { "bin/libLeapC.so": "" }
windows.debug.x86_64 = { "bin/LeapC.dll": "" }
windows.release.x86_64 = { "bin/LeapC.dll": "" }