Commit a5995525 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed Android build when using NDK 19b

parent 248b2e3e
......@@ -30,8 +30,9 @@ if(NOT CMAKE_ANDROID_NDK)
endif()
file(READ "${CMAKE_ANDROID_NDK}/source.properties" SOURCE_PROPERTIES_CONTENT)
string(REGEX MATCH "Pkg\\.Revision = ([0-9]+)\\." NDK_VERSION_MATCH "${SOURCE_PROPERTIES_CONTENT}")
string(REGEX MATCH "Pkg\\.Revision = ([0-9]+)\\.([0-9]+)\\." NDK_VERSION_MATCH "${SOURCE_PROPERTIES_CONTENT}")
set(CMAKE_ANDROID_NDK_VERSION ${CMAKE_MATCH_1})
set(CMAKE_ANDROID_NDK_VERSION_MINOR ${CMAKE_MATCH_2})
if(ENABLE_AAUDIO)
set(ANDROID_NATIVE_API_LEVEL "android-28")
......@@ -45,6 +46,11 @@ include("${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake")
if(CMAKE_ANDROID_NDK_VERSION VERSION_LESS 19)
set(CMAKE_FIND_ROOT_PATH "${CMAKE_SYSROOT}" "${ANDROID_SYSTEM_LIBRARY_PATH}" "${CMAKE_INSTALL_PREFIX}")
else()
# NDK 19b needs this, but not NDK 19
if(CMAKE_ANDROID_NDK_VERSION_MINOR VERSION_EQUAL 1)
set(CMAKE_FIND_ROOT_PATH "${CMAKE_SYSROOT}" "${ANDROID_SYSTEM_LIBRARY_PATH}" "${CMAKE_INSTALL_PREFIX}")
endif()
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-Os -DNDEBUG")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment