[cmake]: Fix ndk r10d compile error

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I64fcf77e7adf13702f98d5d7735338846faff843
This commit is contained in:
Herman Chen
2023-07-25 14:58:33 +08:00
parent f69176591d
commit 44996a76ce
2 changed files with 7 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ FOUND_NDK=0
if [ -z "$ANDROID_NDK" ]; then
# try find ndk path in CMakeCache.txt
if [ -f "CMakeCache.txt" ]; then
ANDROID_NDK=`grep ANDROID_NDK CMakeCache.txt | awk -F '=' '{ print $2 }'`
ANDROID_NDK=`grep ANDROID_NDK\: CMakeCache.txt | awk -F '=' '{ print $2 }'`
if [ -d "${ANDROID_NDK}" ]; then
echo "use android ndk from CMakeCache.txt : ${ANDROID_NDK}"

View File

@@ -86,7 +86,12 @@ set_target_properties(osal PROPERTIES FOLDER "osal")
if(ANDROID)
add_definitions(-static)
# in Android pthread is in libc, also need liblog
target_link_libraries(osal log m)
# Android 14 requires libc++ not libstdc++
if("${ANDROID_STL}" STREQUAL "c++_static")
target_link_libraries(osal log m)
else()
target_link_libraries(osal log stdc++ m)
endif()
endif(ANDROID)
# unit test