Skip to content

Commit

Permalink
fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyl committed Mar 16, 2024
1 parent 789c90d commit 24231e8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test_conan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ jobs:
- name: build-android
run: |
conan build . -b missing -pr:h profiles/android-x86_64 \
-c tools.android:ndk_path="build/android-ndk-$ANDROID_NDK_VERSION"
-c tools.android:ndk_path="`pwd`/build/android-ndk-$ANDROID_NDK_VERSION"
conan build . -b missing -pr:h profiles/android-armv8 \
-c tools.android:ndk_path="build/android-ndk-$ANDROID_NDK_VERSION"
-c tools.android:ndk_path="`pwd`/build/android-ndk-$ANDROID_NDK_VERSION"
conan build . -b missing -pr:h profiles/android-armv7 \
-c tools.android:ndk_path="build/android-ndk-$ANDROID_NDK_VERSION"
-c tools.android:ndk_path="`pwd`/build/android-ndk-$ANDROID_NDK_VERSION"
- uses: actions/upload-artifact@v4
name: upload-android-x86_64
with:
Expand Down
27 changes: 20 additions & 7 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@
from pathlib import Path
import yaml

# for compatibility
arch_map = {
"windows": {
"x86_64": "x64",
},
"linux": {
"x86_64": "x64",
},
"android": {
"x86_64": "x86_64",
"armv8": "arm64-v8a",
"armv7": "armeabi-v7a",
},
"macos": {
"x86_64": "x64",
"armv8": "arm64",
},
}

# (name, enabled)
OCV_MODULES = {
"calib3d": True,
Expand Down Expand Up @@ -379,13 +398,7 @@ def post_build(self):
# archive
install_dir = Path(self.install_folder)
os = str(self.settings.os).lower()
arch = str(self.settings.arch)
if arch == "x86_64" and os != "android":
arch = "x64"
if os == "android":
# keep compatibility
android_arch_map = {"armv8": "arm64-v8a", "armv7": "armeabi-v7a"}
arch = android_arch_map.get(arch, arch)
arch = arch_map[os][str(self.settings.arch)]
new_name = f"lib{self.name}-{os}-{arch}.tar.gz"
fname = self.publish_folder / new_name
print(fname)
Expand Down

0 comments on commit 24231e8

Please sign in to comment.