Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Unable to build with ndk r19b #41

Closed
PeterPetrik opened this issue Feb 27, 2019 · 2 comments · Fixed by #43
Closed

Unable to build with ndk r19b #41

PeterPetrik opened this issue Feb 27, 2019 · 2 comments · Fixed by #43

Comments

@PeterPetrik
Copy link
Contributor

PeterPetrik commented Feb 27, 2019

This change made a policy a bit more strict, so now host paths are ignored for finding QT modules:
android/ndk#890

workaround is to use r19 for now or set -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \ in Qt-CMAKE based recipes

I think best solution would be to set CMAKE_FIND_ROOT_PATH to Android_NDK, Qt and OSGEO4A/build folders , but it has to be fixed upstream android/ndk#919

part of offending ndk/android-toolchain.cmake

# https://github.com/android-ndk/ndk/issues/890
#
# ONLY doesn’t do anything when CMAKE_FIND_ROOT_PATH is not set. Without this,
# CMake will wrongly search host sysroots for headers/libraries. The actual path
# used here is fairly meaningless since CMake doesn’t handle the NDK sysroot
# layout (per-arch and per-verion subdirectories for libraries), so find_library
# is handled separately by CMAKE_SYSTEM_LIBRARY_PATH.
set(CMAKE_FIND_ROOT_PATH “${ANDROID_NDK}“)

# Allow users to override these values in case they want more strict behaviors.
# For example, they may want to prevent the NDK’s libz from being picked up so
# they can use their own.
# https://github.com/android-ndk/ndk/issues/517
if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM)
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
endif()

if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
endif()

if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif()

if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE)
 set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
endif()
@m-kuhn
Copy link
Member

m-kuhn commented Feb 27, 2019

Thanks for the heads up!

@PeterPetrik
Copy link
Contributor Author

looks like they already fixed it for upcoming r19c (android/ndk#912)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants