diff --git a/android/android.toolchain.cmake b/android/android.toolchain.cmake index 82f538fb6b..613024d986 100644 --- a/android/android.toolchain.cmake +++ b/android/android.toolchain.cmake @@ -101,7 +101,8 @@ set( ANDROID_NDK_DEFAULT_SEARCH_PATH /opt/android-ndk-r5b ) set( ANDROID_NDK_TOOLCHAIN_DEFAULT_SEARCH_PATH /opt/android-toolchain ) set( TOOL_OS_SUFFIX "" ) -macro( __TOOLCHAIN_DETECT_API_LEVEL _path _expected) +macro( __TOOLCHAIN_DETECT_API_LEVEL _path ) + SET( _expected ${ARGV1} ) if( NOT EXISTS ${_path} ) message( FATAL_ERROR "Could not verify Android API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." ) endif() @@ -111,7 +112,7 @@ macro( __TOOLCHAIN_DETECT_API_LEVEL _path _expected) message( FATAL_ERROR "Could not verify Android API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." ) endif() string( REGEX REPLACE "${API_LEVEL_REGEX}" "\\1" ANDROID_LEVEL_FOUND "${API_FILE_CONTENT}" ) - if( NOT "${_expected}" STREQUAL "" ) + if( DEFINED _expected ) if( NOT ${ANDROID_LEVEL_FOUND} EQUAL ${_expected} ) message( FATAL_ERROR "Specified Android API level does not match level found. Probably your copy of NDK/toolchain is broken." ) endif() @@ -191,7 +192,7 @@ else() sudo ln -s ~/my-android-toolchain ${ANDROID_NDK_TOOLCHAIN_DEFAULT_SEARCH_PATH}" ) endif() - __TOOLCHAIN_DETECT_API_LEVEL( "${ANDROID_NDK_TOOLCHAIN_ROOT}/include/android/api-level.h" ) + __TOOLCHAIN_DETECT_API_LEVEL( "${ANDROID_NDK_TOOLCHAIN_ROOT}/sysroot/usr/include/android/api-level.h" ) #message( STATUS "Using android NDK standalone toolchain from ${ANDROID_NDK_TOOLCHAIN_ROOT}" ) set( BUILD_WITH_ANDROID_NDK_TOOLCHAIN True )