From d5ed6a0d32da8eb2d97040018325908a68e295fd Mon Sep 17 00:00:00 2001 From: rodolpheh Date: Mon, 6 Nov 2023 20:35:49 +0000 Subject: [PATCH] Add post-action copy dll for Windows --- SConstruct | 17 +++++++++++++---- .../godot_ultraleap_plugin.gdextension | 7 ++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index f628680..2831ab1 100644 --- a/SConstruct +++ b/SConstruct @@ -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) \ No newline at end of file +if library is not None: + for post_action in post_actions: + AddPostAction(library, post_action) + + Default(library) +else: + print("Nothing to build, weird") \ No newline at end of file diff --git a/demo/addons/godot_ultraleap_plugin/godot_ultraleap_plugin.gdextension b/demo/addons/godot_ultraleap_plugin/godot_ultraleap_plugin.gdextension index 99a5d53..961c2aa 100644 --- a/demo/addons/godot_ultraleap_plugin/godot_ultraleap_plugin.gdextension +++ b/demo/addons/godot_ultraleap_plugin/godot_ultraleap_plugin.gdextension @@ -16,6 +16,7 @@ android.release.arm64 = "bin/libgdultraleap.android.template_release.arm64.so" [dependencies] -android.debug.arm64 = { - "bin/libLeapC.so": "" -} \ No newline at end of file +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": "" } \ No newline at end of file