Skip to content

Commit

Permalink
remove build type from libraries name
Browse files Browse the repository at this point in the history
distinguish between debug/release seems to make things more complicated
  • Loading branch information
j20001970 committed May 9, 2024
1 parent 27a2105 commit 90c7fe1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_addon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ jobs:
cp build-artifact-windows/*.dll addons/GDMP/libs/x86_64/
cp build-artifact-linux/*.so addons/GDMP/libs/x86_64/
cp build-artifact-android/*.aar addons/GDMP/libs
mv addons/GDMP/libs/GDMP-release.aar addons/GDMP/libs/GDMP.android.aar
unzip -o build-artifact-ios/GDMP.zip -d addons/GDMP/libs
- name: Patch GDMP.gdextension
run: |
sed -i 's/libGDMP\..*\.so/libGDMP.so/g' addons/GDMP/GDMP.gdextension
sed -i 's/GDMP\..*\.dll/GDMP.dll/g' addons/GDMP/GDMP.gdextension
sed -i 's/GDMP\..*\.framework/GDMP.ios.release.framework/g' addons/GDMP/GDMP.gdextension
sed -i 's/opencv_world3410d/opencv_world3410/g' addons/GDMP/GDMP.gdextension
- name: Create Addon Artifact
Expand Down
15 changes: 1 addition & 14 deletions GDMP/ios/BUILD
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_framework")

config_setting(
name = "debug",
values = {"compilation_mode": "dbg"},
)

config_setting(
name = "release",
values = {"compilation_mode": "opt"},
)

ios_framework(
name = "GDMP",
bundle_id = "io.gdmp",
bundle_name = select({
":debug": "GDMP.ios.debug",
":release": "GDMP.ios.release",
}),
bundle_name = "GDMP.ios",
families = [
"iphone",
"ipad",
Expand Down
15 changes: 5 additions & 10 deletions addons/GDMP/GDMP.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@ compatibility_minimum = 4.1

[libraries]

linux.debug.x86_64 = "res://addons/GDMP/libs/x86_64/libGDMP.linux.debug.so"
linux.release.x86_64 = "res://addons/GDMP/libs/x86_64/libGDMP.linux.release.so"
windows.debug.x86_64 = "res://addons/GDMP/libs/x86_64/GDMP.windows.debug.dll"
windows.release.x86_64 = "res://addons/GDMP/libs/x86_64/GDMP.windows.release.dll"
ios.debug = "res://addons/GDMP/libs/GDMP.ios.debug.framework"
ios.release = "res://addons/GDMP/libs/GDMP.ios.release.framework"
linux.x86_64 = "res://addons/GDMP/libs/x86_64/libGDMP.linux.so"
windows.x86_64 = "res://addons/GDMP/libs/x86_64/GDMP.windows.dll"
ios = "res://addons/GDMP/libs/GDMP.ios.framework"

[dependencies]

windows.debug.x86_64 = {
"res://addons/GDMP/libs/x86_64/opencv_world3410d.dll": "",
}
windows.release.x86_64 = {
windows.x86_64 = {
"res://addons/GDMP/libs/x86_64/opencv_world3410.dll": "",
"res://addons/GDMP/libs/x86_64/opencv_world3410d.dll": "",
}
5 changes: 1 addition & 4 deletions addons/GDMP/editor/android_export_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ func _supports_platform(platform: EditorExportPlatform) -> bool:
return false

func _get_android_libraries(platform:EditorExportPlatform, debug: bool) -> PackedStringArray:
if debug:
return PackedStringArray(["GDMP/libs/GDMP-debug.aar"])
else:
return PackedStringArray(["GDMP/libs/GDMP-release.aar"])
return PackedStringArray(["GDMP/libs/GDMP.android.aar"])

func _get_android_dependencies(platform: EditorExportPlatform, debug: bool) -> PackedStringArray:
var camerax_version: String = "1.0.0-beta10"
Expand Down
8 changes: 3 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def copy_android(args: Namespace):
sys.exit(-1)
src = path.join(MEDIAPIPE_DIR, "bazel-bin/GDMP/android/libGDMP.so")
jni_dst = path.join(android_project, "src/main/jniLibs")
dst = path.join(jni_dst, build_type, arch, path.basename(src))
dst = path.join(jni_dst, arch, path.basename(src))
i = input(f"Copy {path.basename(src)} to {path.relpath(dst)}? [Y/n] ")
if len(i) and not i.lower().startswith("y"):
return
Expand Down Expand Up @@ -129,11 +129,10 @@ def copy_android(args: Namespace):
if ret == 0:
dst = "addons/GDMP/libs"
aar = path.join(android_project, f"build/outputs/aar/GDMP-{build_type}.aar")
copy_to_godot(aar, path.join(dst, path.basename(aar)))
copy_to_godot(aar, path.join(dst, "GDMP.android.aar"))


def copy_desktop(args: Namespace):
build_type: str = args.type
arch: str = args.arch
if arch is None:
arch = platform.machine().lower()
Expand All @@ -147,7 +146,7 @@ def copy_desktop(args: Namespace):
src = path.join(desktop_output, "GDMP.dll")
dst = path.join("addons/GDMP/libs", arch)
filename = path.basename(src).split(".")
filename = ".".join([filename[0], desktop_platform, build_type, filename[-1]])
filename = ".".join([filename[0], desktop_platform, filename[-1]])
copy_to_godot(src, path.join(dst, filename))
if desktop_platform == "windows":
opencv_lib = glob.glob(path.join(desktop_output, "opencv_world*.dll"))
Expand All @@ -158,7 +157,6 @@ def copy_desktop(args: Namespace):


def copy_ios(args: Namespace):
build_type: str = args.type
src = path.join(MEDIAPIPE_DIR, "bazel-bin/GDMP/ios/GDMP.zip")
dst = "addons/GDMP/libs"
if GODOT_PATH is None:
Expand Down

0 comments on commit 90c7fe1

Please sign in to comment.