From bc0bb075aba1552f30a3382d315c55384ab94d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 29 Mar 2021 18:07:33 +0200 Subject: [PATCH] Update Android installation layout to better comply with NDK r19+. And take CMake 3.20 into account. --- CMakeLists.txt | 20 ++++--- doc/building.dox | 72 +++++++++++++++--------- doc/changelog.dox | 8 +++ doc/platforms-android.dox | 40 +++++++++---- modules/FindCorrade.cmake | 12 ++-- modules/FindMagnum.cmake | 22 +++++--- package/archlinux/PKGBUILD-android-arm64 | 7 +-- 7 files changed, 115 insertions(+), 66 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5f7ef9ed..593c31166 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,8 +183,6 @@ endif() set(MAGNUM_DEPLOY_PREFIX "." CACHE STRING "Prefix where to put final application executables") -set(MAGNUM_INCLUDE_INSTALL_PREFIX "." - CACHE STRING "Prefix where to put platform-independent include and other files") option(BUILD_STATIC "Build static libraries (default are shared)" OFF) # Disable PIC on Emscripten by default (but still allow it to be enabled @@ -341,11 +339,19 @@ endif() include(${CORRADE_LIB_SUFFIX_MODULE}) set(MAGNUM_BINARY_INSTALL_DIR bin) set(MAGNUM_LIBRARY_INSTALL_DIR lib${LIB_SUFFIX}) -set(MAGNUM_DATA_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/share/magnum) -set(MAGNUM_CMAKE_MODULE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/share/cmake/Magnum) -set(MAGNUM_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/Magnum) -set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/MagnumExternal) -set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/MagnumPlugins) +set(MAGNUM_DATA_INSTALL_DIR share/magnum) +set(MAGNUM_CMAKE_MODULE_INSTALL_DIR share/cmake/Magnum) +set(MAGNUM_INCLUDE_INSTALL_DIR include/Magnum) +set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR include/MagnumExternal) +set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR include/MagnumPlugins) +if(MAGNUM_BUILD_DEPRECATED AND MAGNUM_INCLUDE_INSTALL_PREFIX AND NOT MAGNUM_INCLUDE_INSTALL_PREFIX STREQUAL ".") + message(DEPRECATION "MAGNUM_INCLUDE_INSTALL_PREFIX is obsolete as its primary use was for old Android NDK versions. Please switch to the NDK r19+ layout instead of using this variable and recreate your build directory to get rid of this warning.") + set(MAGNUM_DATA_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_DATA_INSTALL_DIR}) + set(MAGNUM_CMAKE_MODULE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_CMAKE_MODULE_INSTALL_DIR}) + set(MAGNUM_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_INCLUDE_INSTALL_DIR}) + set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}) + set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}) +endif() # Separate install dirs for debug and release plugins set(MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_BINARY_INSTALL_DIR}/magnum-d) diff --git a/doc/building.dox b/doc/building.dox index 7b57d18a8..a2baba56e 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -698,20 +698,29 @@ installed files. The following variables are supported: - `LIB_SUFFIX` --- Setting this variable to `64` can be used to tell CMake to install to `lib64/` instead of `lib/`. In most cases this variable is - autodetected, so you don't need to set it yourself. + autodetected, so you don't need to set it yourself. On + @ref CORRADE_TARGET_ANDROID "Android", if `CMAKE_INSTALL_PREFIX` points to + the NDK sysroot, it gets automatically set to + `/${CMAKE_ANDROID_ARCH_TRIPLE}/${CMAKE_SYSTEM_VERSION}` to put the binaries + to correct location for given architecture and API level version. - `MAGNUM_DEPLOY_PREFIX` --- Used on @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" to override location where web demos and utilities (such as @ref magnum-gl-info) are installed, so you can have libraries installed to a system location and utilities to your webserver, for example. Defaults to ``.``. If a relative path is used, it's relative to `CMAKE_INSTALL_PREFIX`. -- `MAGNUM_INCLUDE_INSTALL_PREFIX` --- Used on @ref CORRADE_TARGET_ANDROID "Android" - to override location where platform-independent include files, CMake - scripts and other files are installed. CMake on Android by default searches - for binaries in <ndk>/platforms/android-<api>/arch-<arch>/usr - based on target API and platform, but looks for headers in a central - location at <ndk>/toolchains/llvm/prebuilt/<host>/sysroot/usr. - Defaults to ``.``. If a relative path is used, it's relative to - `CMAKE_INSTALL_PREFIX`. + +The following variables are deprecated and provided only for backwards +compatibility if `BUILD_DEPRECATED` isn't disabled. + +- `MAGNUM_INCLUDE_INSTALL_PREFIX` --- Overrides location where + platform-independent include files, CMake scripts and other files are + installed. For NDK versions before r19, CMake on Android by default + searched for binaries in <ndk>/platforms/android-<api>/arch-<arch>/usr + based on target API and platform, but for headers in a central location at + <ndk>/toolchains/llvm/prebuilt/<host>/sysroot/usr and + this was used to handle that case. Nowadays please use NDK r19 and newer, + with the unified sysroot layout. Defaults to ``.``. If a relative path is + used, it's relative to `CMAKE_INSTALL_PREFIX`. Various plugin interfaces search for plugins in locations and order documented in @ref Corrade::PluginManager::implicitPluginSearchPaths(), @@ -1059,22 +1068,33 @@ Create a build directory and run `cmake` and the build command in it. Set ABI. Check the [CMake Android cross-compiling documentation](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-android) for further information. You can omit specifying `CORRADE_RC_EXECUTABLE` if @ref building-cross-corrade-rc "natively-built corrade-rc" is accessible -through `PATH`. +through `PATH`. Note that `BUILD_STATIC` is implicitly enabled, because +manually loading all depending shared libraries using JNI would be too +inconvenient. The engine is built for OpenGL ES 2.0 by default, switch to 3.0 +by disabling `TARGET_GLES2`. If you set `CMAKE_INSTALL_PREFIX` to `/usr` subdirectory of the particular -Android platform sysroot, the package will get found automatically when -compiling depending projects. Gradle and other Android buildsystems expect -platform-independent includes and other files to be stored in a central -location, you can point `MAGNUM_INCLUDE_INSTALL_PREFIX` there to install the -includes separately. Another option is to explicitly set `CMAKE_PREFIX_PATH` -to the install location in depending projects. Unfortunately, CMake needs extra -help with `CMAKE_FIND_ROOT_PATH` to correctly find Android libraries, otherwise -it falls back to looking in native system locations. Adapt them to your -system, Android ABI and version and NDK location as needed. - -Note that `BUILD_STATIC` is implicitly enabled, because manually loading all -depending shared libraries using JNI would be too inconvenient. The engine is -built for OpenGL ES 2.0 by default, switch to 3.0 by disabling `TARGET_GLES2`. +Android platform sysroot (as shown below), Magnum's buildsystem will also pick +a `LIB_SUFFIX` corresponding to a particular ABI and version, which in turn +makes the package automatically discoverable when compiling depending projects, +both with vanilla CMake and with Gradle. Another option is to explicitly set +`CMAKE_PREFIX_PATH` to the install location in depending projects. + + + +@m_class{m-note m-warning} + +@par + Unfortunately, CMake before version 3.20 needs extra help with + `CMAKE_FIND_ROOT_PATH` and `CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` to + correctly find Android libraries, as shown below. Otherwise it falls back + to looking in native system locations. Adapt them to your system, Android + ABI and version and NDK location as needed. +@par + CMake 3.20 and newer [is now able to detect everything on its own](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5357) + and you don't need to supply these anymore. + + @m_class{m-console-wrap} @@ -1086,10 +1106,10 @@ cmake .. \ -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ -DCMAKE_ANDROID_STL_TYPE=c++_static \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/opt/android-ndk/platforms/android-24/arch-arm64/usr \ - -DCMAKE_FIND_ROOT_PATH="/opt/android-ndk/platforms/android-24/arch-arm64;/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot" \ + -DCMAKE_INSTALL_PREFIX=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr \ + -DCMAKE_FIND_ROOT_PATH=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot \ + -DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=/aarch64-linux-android/24 \ -DCORRADE_RC_EXECUTABLE=/path/to/corrade-rc \ - -DMAGNUM_INCLUDE_INSTALL_PREFIX=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr \ -DTARGET_GLES2=OFF \ -DWITH_ANDROIDAPPLICATION=ON cmake --build . diff --git a/doc/changelog.dox b/doc/changelog.dox index e90a5b477..b94e6c63d 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -330,6 +330,14 @@ See also: - The `FindSDL2.cmake` module was updated to allow using SDL2 as a subproject. See the @ref Platform-Sdl2Application-usage "Platform::Sdl2Application docs" for more information. See also [mosra/magnum#496](https://github.com/mosra/magnum/issues/496). +- With CMake 3.20 and newer it's possible to compile for Android NDK r19+ + without explicitly supplying various system paths. Additionally, when `CMAKE_INSTALL_PREFIX` points to Android NDK sysroot, the `LIB_SUFFIX` + gets autodetected to a correct triplet + API level version subdirectory, + making the installed project discoverable by both vanilla CMake and Gradle. + On CMake 3.16 to 3.19 it's required to set two extra variables for the + same effect. See @ref building-cross-android, @ref platforms-android and + [mosra/magnum#310](https://github.com/mosra/magnum/issues/310) for more + information. @subsection changelog-latest-bugfixes Bug fixes diff --git a/doc/platforms-android.dox b/doc/platforms-android.dox index 629f62020..5be3d9997 100644 --- a/doc/platforms-android.dox +++ b/doc/platforms-android.dox @@ -70,10 +70,22 @@ different. Android allows to run arbitrary console utilities and tests via ADB. Assuming you have Magnum installed in the NDK path as described in @ref building-cross-android, -build your project as below. The `CMAKE_FIND_ROOT_PATH` is unfortunately needed -for CMake to correctly find Android libraries, otherwise it falls back to -looking in native system locations. Adapt paths to your system, Android ABI and -version and NDK location as needed: +build your project as below. Adapt paths to your system, Android ABI and +version and NDK location as needed. + + + +@m_class{m-note m-warning} + +@par + Unfortunately, CMake before version 3.20 needs extra help with + `CMAKE_FIND_ROOT_PATH` and `CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` to + correctly find Android libraries, as shown below. Otherwise it falls back + to looking in native system locations. Again, adapt them to your system, + Android ABI and version and NDK location as needed. +@par + CMake 3.20 and newer [is now able to detect everything on its own](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5357) + and you don't need to supply these anymore. @m_class{m-console-wrap} @@ -84,7 +96,8 @@ cmake .. \ -DCMAKE_SYSTEM_VERSION=24 \ -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ -DCMAKE_ANDROID_STL_TYPE=c++_static \ - -DCMAKE_FIND_ROOT_PATH="/opt/android-ndk/platforms/android-24/arch-arm64;/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot" \ + -DCMAKE_FIND_ROOT_PATH=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot \ + -DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=/aarch64-linux-android/24 \ -DCMAKE_BUILD_TYPE=Release cmake --build . @endcode @@ -409,7 +422,10 @@ After that, you can add the additional ABIs to the `abiFilters` list in your `build.gradle`. For example, building Magnum for 32-bit and 64-bit ARM with SDK version 24 -could look like this: +could look like this. The same note regarding CMake 3.20 applies here --- on +versions before, you need the `CMAKE_FIND_ROOT_PATH` and +`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variables as well (and have them in sync +with the ABI and API version level), on 3.20 and newer you can omit them. @m_class{m-console-wrap} @@ -421,9 +437,9 @@ cmake .. \ -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a \ -DCMAKE_ANDROID_STL_TYPE=c++_static \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/platforms/android-24/arch-arm/usr \ - -DCMAKE_FIND_ROOT_PATH="platforms/android-24/arch-arm;/toolchains/llvm/prebuilt/linux-x86_64/sysroot" \ - -DMAGNUM_INCLUDE_INSTALL_PREFIX=/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr + -DCMAKE_INSTALL_PREFIX=/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr \ + -DCMAKE_FIND_ROOT_PATH=/toolchains/llvm/prebuilt/linux-x86_64/sysroot \ + -DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=/arm-linux-androideabi/24 cmake --build . --target install cd .. @@ -435,9 +451,9 @@ cmake .. \ -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ -DCMAKE_ANDROID_STL_TYPE=c++_static \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/platforms/android-24/arch-arm64/usr \ - -DCMAKE_FIND_ROOT_PATH="platforms/android-24/arch-arm64;/toolchains/llvm/prebuilt/linux-x86_64/sysroot" \ - -DMAGNUM_INCLUDE_INSTALL_PREFIX=/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr + -DCMAKE_INSTALL_PREFIX=/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr \ + -DCMAKE_FIND_ROOT_PATH=/toolchains/llvm/prebuilt/linux-x86_64/sysroot \ + -DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=/aarch64-linux-android/24 cmake --build . --target install @endcode diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index 1747711e6..9a36cce28 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -11,9 +11,6 @@ # # Corrade_FOUND - Whether the base library was found # CORRADE_LIB_SUFFIX_MODULE - Path to CorradeLibSuffix.cmake module -# CORRADE_INCLUDE_INSTALL_PREFIX - Prefix where to put platform-independent -# include and other files, defaults to ``.``. If a relative path is used, -# it's relative to :variable:`CMAKE_INSTALL_PREFIX`. # # This command will try to find only the base library, not the optional # components, which are: @@ -618,8 +615,9 @@ find_package_handle_standard_args(Corrade REQUIRED_VARS # Finalize the finding process include(${CORRADE_USE_MODULE}) -# Installation dirs -set(CORRADE_INCLUDE_INSTALL_PREFIX "." - CACHE STRING "Prefix where to put platform-independent include and other files") +set(CORRADE_INCLUDE_INSTALL_DIR include/Corrade) -set(CORRADE_INCLUDE_INSTALL_DIR ${CORRADE_INCLUDE_INSTALL_PREFIX}/include/Corrade) +if(CORRADE_BUILD_DEPRECATED AND CORRADE_INCLUDE_INSTALL_PREFIX AND NOT CORRADE_INCLUDE_INSTALL_PREFIX STREQUAL ".") + message(DEPRECATION "CORRADE_INCLUDE_INSTALL_PREFIX is obsolete as its primary use was for old Android NDK versions. Please switch to the NDK r19+ layout instead of using this variable and recreate your build directory to get rid of this warning.") + set(CORRADE_INCLUDE_INSTALL_DIR ${CORRADE_INCLUDE_INSTALL_PREFIX}/${CORRADE_INCLUDE_INSTALL_DIR}) +endif() diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index a05edf03f..1c150aa05 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -13,9 +13,6 @@ # MAGNUM_DEPLOY_PREFIX - Prefix where to put final application # executables, defaults to ``.``. If a relative path is used, it's relative # to :variable:`CMAKE_INSTALL_PREFIX`. -# MAGNUM_INCLUDE_INSTALL_PREFIX - Prefix where to put platform-independent -# include and other files, defaults to ``.``. If a relative path is used, -# it's relative to :variable:`CMAKE_INSTALL_PREFIX`. # MAGNUM_PLUGINS_DEBUG_DIR - Base directory with dynamic plugins for # debug builds, defaults to magnum-d/ subdirectory of dir where Magnum # library was found @@ -1185,17 +1182,27 @@ endif() # Installation and deploy dirs set(MAGNUM_DEPLOY_PREFIX "." CACHE STRING "Prefix where to put final application executables") -set(MAGNUM_INCLUDE_INSTALL_PREFIX "." - CACHE STRING "Prefix where to put platform-independent include and other files") include(${CORRADE_LIB_SUFFIX_MODULE}) set(MAGNUM_BINARY_INSTALL_DIR bin) set(MAGNUM_LIBRARY_INSTALL_DIR lib${LIB_SUFFIX}) -set(MAGNUM_DATA_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/share/magnum) +set(MAGNUM_DATA_INSTALL_DIR share/magnum) +set(MAGNUM_INCLUDE_INSTALL_DIR include/Magnum) +set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR include/MagnumExternal) +set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR include/MagnumPlugins) +if(MAGNUM_BUILD_DEPRECATED AND MAGNUM_INCLUDE_INSTALL_PREFIX AND NOT MAGNUM_INCLUDE_INSTALL_PREFIX STREQUAL ".") + message(DEPRECATION "MAGNUM_INCLUDE_INSTALL_PREFIX is obsolete as its primary use was for old Android NDK versions. Please switch to the NDK r19+ layout instead of using this variable and recreate your build directory to get rid of this warning.") + set(MAGNUM_DATA_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_DATA_INSTALL_DIR}) + set(MAGNUM_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_INCLUDE_INSTALL_DIR}) + set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}) + set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}) +endif() + set(MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_BINARY_INSTALL_DIR}/magnum-d) set(MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum-d) set(MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_BINARY_INSTALL_DIR}/magnum) set(MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum) + set(MAGNUM_PLUGINS_SHADERCONVERTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/shaderconverters) set(MAGNUM_PLUGINS_SHADERCONVERTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/shaderconverters) set(MAGNUM_PLUGINS_SHADERCONVERTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/shaderconverters) @@ -1222,9 +1229,6 @@ set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/audioimporters) set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/audioimporters) set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/audioimporters) -set(MAGNUM_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/Magnum) -set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/MagnumExternal) -set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/MagnumPlugins) # Get base plugin directory from main library location. This is *not* PATH, # because CMake always converts the path to an absolute location internally, diff --git a/package/archlinux/PKGBUILD-android-arm64 b/package/archlinux/PKGBUILD-android-arm64 index 65fb08c03..8697430be 100644 --- a/package/archlinux/PKGBUILD-android-arm64 +++ b/package/archlinux/PKGBUILD-android-arm64 @@ -7,7 +7,7 @@ arch=('any') url="https://magnum.graphics" license=('MIT') depends=('android-arm64-corrade') -makedepends=('cmake' 'ninja' 'android-ndk' 'corrade') +makedepends=('cmake>=3.20' 'ninja' 'android-ndk' 'corrade') options=('!strip' '!buildflags') _rootdir=$startdir/../../ @@ -22,17 +22,14 @@ build() { -DCMAKE_SYSTEM_VERSION=24 \ -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ -DCMAKE_ANDROID_STL_TYPE=c++_static \ - -DCMAKE_FIND_ROOT_PATH="/opt/android-ndk/platforms/android-24/arch-arm64;/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot" \ + -DCMAKE_INSTALL_PREFIX=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr \ -G Ninja - fi cd "$_rootdir/build-android-arm64" cmake .. \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/opt/android-ndk/platforms/android-24/arch-arm64/usr \ - -DMAGNUM_INCLUDE_INSTALL_PREFIX=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr \ -DWITH_VK=ON \ -DWITH_ANYAUDIOIMPORTER=OFF \ -DWITH_ANYIMAGECONVERTER=ON \