From 7a4e27e5f054f418f4aa08c6c0c3c22c50bf0c97 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 19 Dec 2023 16:38:02 +0100 Subject: [MacOS] Use framekwork to package GDExtension This allows it to be code-signed as a bundle so gatekeeper won't complain when loaded by the editor. --- SConstruct | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 9080be6..6d012ff 100644 --- a/SConstruct +++ b/SConstruct @@ -177,7 +177,19 @@ env.Depends(sources, ssl + rtc) # Make the shared library result_name = "libwebrtc_native{}{}".format(env["suffix"], env["SHLIBSUFFIX"]) -library = env.SharedLibrary(target=os.path.join(result_path, "lib", result_name), source=sources) +if env["godot_version"] != "3" and env["platform"] == "macos": + framework_path = os.path.join( + result_path, "lib", "libwebrtc_native.macos.{}.{}.framework".format(env["target"], env["arch"]) + ) + library_file = env.SharedLibrary(target=os.path.join(framework_path, result_name), source=sources) + plist_file = env.Substfile( + os.path.join(framework_path, "Resources", "Info.plist"), + "misc/dist/macos/Info.plist", + SUBST_DICT={"{LIBRARY_NAME}": result_name, "{DISPLAY_NAME}": "libwebrtc_native" + env["suffix"]}, + ) + library = [library_file, plist_file] +else: + library = env.SharedLibrary(target=os.path.join(result_path, "lib", result_name), source=sources) Default(library) # GDNativeLibrary -- cgit v1.2.3