From 785c889dd5871204b7f4dc8c0f52970f2359b809 Mon Sep 17 00:00:00 2001 From: Xiaolei Yu Date: Wed, 18 Nov 2015 10:56:12 +0800 Subject: [PATCH] Set CMAKE_SYSROOT on CMake 3.0.0 and later --- android.toolchain.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android.toolchain.cmake b/android.toolchain.cmake index ffa2612..7aacd4f 100644 --- a/android.toolchain.cmake +++ b/android.toolchain.cmake @@ -1166,7 +1166,9 @@ endforeach() remove_definitions( -DANDROID ) add_definitions( -DANDROID ) -if( ANDROID_SYSROOT MATCHES "[ ;\"]" ) +if( CMAKE_VERSION VERSION_GREATER "3.0.0" ) + set( CMAKE_SYSROOT ${ANDROID_SYSROOT} ) +elseif( ANDROID_SYSROOT MATCHES "[ ;\"]" ) if( CMAKE_HOST_WIN32 ) # try to convert path to 8.3 form file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd" "@echo %~s1" )