diff --git a/.github/workflows/test_conan.yaml b/.github/workflows/test_conan.yaml index 66c85961..47163a36 100644 --- a/.github/workflows/test_conan.yaml +++ b/.github/workflows/test_conan.yaml @@ -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: diff --git a/conanfile.py b/conanfile.py index b62f96b6..31ec9628 100644 --- a/conanfile.py +++ b/conanfile.py @@ -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, @@ -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)