@ -65,6 +65,7 @@
# " a r m e a b i " - A R M v 5 T E b a s e d C P U w i t h s o f t w a r e f l o a t i n g p o i n t o p e r a t i o n s
# " a r m e a b i - v 7 a " - A R M v 7 b a s e d d e v i c e s w i t h h a r d w a r e F P U i n s t r u c t i o n s
# t h i s A B I t a r g e t i s u s e d b y d e f a u l t
# " a r m e a b i - v 7 a - h a r d w i t h N E O N " - A R M v 7 b a s e d d e v i c e s w i t h h a r d w a r e F P U i n s t r u c t i o n s a n d h a r d f p
# " a r m e a b i - v 7 a w i t h N E O N " - s a m e a s a r m e a b i - v 7 a , b u t
# s e t s N E O N a s f l o a t i n g - p o i n t u n i t
# " a r m e a b i - v 7 a w i t h V F P V 3 " - s a m e a s a r m e a b i - v 7 a , b u t
@ -178,7 +179,7 @@
# A N D R O I D a n d B U I L D _ A N D R O I D w i l l b e s e t t o t r u e , y o u m a y t e s t a n y o f t h e s e
# v a r i a b l e s t o m a k e n e c e s s a r y A n d r o i d - s p e c i f i c c o n f i g u r a t i o n c h a n g e s .
#
# A l s o A R M E A B I o r A R M E A B I _ V 7 A o r X 8 6 o r M I P S o r A R M 6 4 _ V 8 A o r X 8 6 _ 6 4 o r M I P S 6 4
# A l s o A R M E A B I o r A R M E A B I _ V 7 A o r A R M E A B I _ V 7 A _ H A R D o r X 8 6 o r M I P S o r A R M 6 4 _ V 8 A o r X 8 6 _ 6 4 o r M I P S 6 4
# w i l l b e s e t t r u e , m u t u a l l y e x c l u s i v e . N E O N o p t i o n w i l l b e s e t t r u e
# i f V F P i s s e t t o N E O N .
#
@ -231,7 +232,7 @@ if( NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH )
endif ( )
# k n o w n A B I s
set ( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" )
set ( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a-hard with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" )
set ( ANDROID_SUPPORTED_ABIS_arm64 "arm64-v8a" )
set ( ANDROID_SUPPORTED_ABIS_x86 "x86" )
set ( ANDROID_SUPPORTED_ABIS_x86_64 "x86_64" )
@ -711,6 +712,14 @@ elseif( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" )
set ( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
set ( VFPV3 true )
set ( NEON true )
elseif ( ANDROID_ABI STREQUAL "armeabi-v7a-hard with NEON" )
set ( ARMEABI_V7A_HARD true )
set ( ANDROID_NDK_ABI_NAME "armeabi-v7a-hard" )
set ( ANDROID_ARCH_NAME "arm" )
set ( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
set ( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
set ( VFPV3 true )
set ( NEON true )
else ( )
message ( SEND_ERROR "Unknown ANDROID_ABI=\" ${ ANDROID_ABI } \" is specified. " )
endif ( )
@ -904,7 +913,7 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN )
# o l d location ( pre r8c )
set ( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
endif ( )
if ( ARMEABI_V7A AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" )
if ( ( ARMEABI_V7A OR ARMEABI_V7A_HARD ) AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" )
list ( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}" )
elseif ( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits" )
list ( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb" )
@ -912,9 +921,9 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN )
list ( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" )
endif ( )
# a l w a y s s e a r c h s t a t i c G N U S T L t o g e t t h e l o c a t i o n o f l i b s u p c + + . a
if ( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )
if ( ( ARMEABI_V7A OR ARMEABI_V7A_HARD ) AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb" )
elseif ( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" )
elseif ( ( ARMEABI_V7A OR ARMEABI_V7A_HARD ) AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}" )
elseif ( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libstdc++.a" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb" )
@ -935,7 +944,7 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN )
" )
endif ( )
if ( ANDROID_STL STREQUAL "gnustl_shared" )
if ( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
if ( ( ARMEABI_V7A OR ARMEABI_V7A_HARD ) AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
elseif ( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
@ -1198,7 +1207,7 @@ if (ARM64_V8A )
if ( NOT ANDROID_COMPILER_IS_CLANG )
set ( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" )
endif ( )
elseif ( ARMEABI OR ARMEABI_V7A )
elseif ( ARMEABI OR ARMEABI_V7A OR ARMEABI_V7A_HARD )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
if ( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 )
set ( ANDROID_CXX_FLAGS_RELEASE "-mthumb -fomit-frame-pointer -fno-strict-aliasing" )
@ -1245,7 +1254,16 @@ if( NOT ANDROID_COMPILER_VERSION VERSION_LESS "4.6" )
endif ( )
# A B I - s p e c i f i c f l a g s
if ( ARMEABI_V7A )
if ( ARMEABI_V7A_HARD )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1" )
if ( NEON )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=neon" )
elseif ( VFPV3 )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3" )
else ( )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3-d16" )
endif ( )
elseif ( ARMEABI_V7A )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv7-a -mfloat-abi=softfp" )
if ( NEON )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=neon" )
@ -1254,6 +1272,7 @@ if( ARMEABI_V7A )
else ( )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3-d16" )
endif ( )
elseif ( ARMEABI_V6 )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp" ) # v f p = = v f p v 2
elseif ( ARMEABI )
@ -1330,6 +1349,10 @@ if( ARMEABI_V7A )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--fix-cortex-a8" )
endif ( )
if ( ARMEABI_V7A_HARD )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--no-warn-mismatch -lm_hard" )
endif ( )
if ( ANDROID_NO_UNDEFINED )
if ( MIPS )
# t h e r e i s s o m e s y s r o o t - r e l a t e d p r o b l e m i n m i p s l i n k e r . . .
@ -1351,7 +1374,7 @@ if( ANDROID_FUNCTION_LEVEL_LINKING )
endif ( )
if ( ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
if ( ANDROID_GOLD_LINKER AND ( CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE_NUM GREATER 8002 ) AND ( ARMEABI OR ARMEABI_V7A OR X86 ) )
if ( ANDROID_GOLD_LINKER AND ( CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE_NUM GREATER 8002 ) AND ( ARMEABI OR ARMEABI_V7A OR ARMEABI_V7A_HARD OR X86 ) )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
elseif ( ANDROID_NDK_RELEASE_NUM GREATER 8002 ) # a f t e r r 8 b
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=bfd" )
@ -1626,7 +1649,7 @@ endif()
# V a r i a b l e s c o n t r o l l i n g b e h a v i o r o r s e t b y c m a k e t o o l c h a i n :
# A N D R O I D _ A B I : " a r m e a b i - v 7 a " ( d e f a u l t ) , " a r m e a b i " , " a r m e a b i - v 7 a w i t h N E O N " , " a r m e a b i - v 7 a w i t h V F P V 3 " , " a r m e a b i - v 6 w i t h V F P " , " x 8 6 " , " m i p s " , " a r m 6 4 - v 8 a " , " x 8 6 _ 6 4 " , " m i p s 6 4 "
# A N D R O I D _ A B I : " a r m e a b i - v 7 a " ( d e f a u l t ) , " a r m e a b i " , " a r m e a b i - v 7 a w i t h N E O N " , " a r m e a b i - v 7 a - h a r d w i t h N E O N " , " a r m e a b i - v 7 a w i t h V F P V 3 " , " a r m e a b i - v 6 w i t h V F P " , " x 8 6 " , " m i p s " , " a r m 6 4 - v 8 a " , " x 8 6 _ 6 4 " , " m i p s 6 4 "
# A N D R O I D _ N A T I V E _ A P I _ L E V E L : 3 , 4 , 5 , 8 , 9 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 21 ( depends on NDK version )
# A N D R O I D _ S T L : g n u s t l _ s t a t i c / g n u s t l _ s h a r e d / s t l p o r t _ s t a t i c / s t l p o r t _ s h a r e d / g a b i + + _ s t a t i c / g a b i + + _ s h a r e d / s y s t e m _ r e / s y s t e m / n o n e
# A N D R O I D _ F O R B I D _ S Y G W I N : O N / O F F
@ -1653,6 +1676,7 @@ endif()
# A R M E A B I : T R U E f o r a r m v 6 a n d o l d e r d e v i c e s
# A R M E A B I _ V 6 : T R U E f o r a r m v 6
# A R M E A B I _ V 7 A : T R U E f o r a r m v 7 a
# A R M E A B I _ V 7 A _ H A R D : T R U E f o r a r m v 7 a w i t h h a r d f p
# A R M 6 4 _ V 8 A : T R U E f o r a r m 6 4 - v 8 a
# N E O N : T R U E i f N E O N u n i t i s e n a b l e d
# V F P V 3 : T R U E i f V F P v e r s i o n 3 i s e n a b l e d
@ -1663,7 +1687,7 @@ endif()
# B U I L D _ W I T H _ A N D R O I D _ N D K : T R U E i f N D K i s u s e d
# B U I L D _ W I T H _ S T A N D A L O N E _ T O O L C H A I N : T R U E i f s t a n d a l o n e t o o l c h a i n i s u s e d
# A N D R O I D _ N D K _ H O S T _ S Y S T E M _ N A M E : " w i n d o w s " , " l i n u x - x 8 6 " o r " d a r w i n - x 8 6 " d e p e n d i n g o n h o s t p l a t f o r m
# A N D R O I D _ N D K _ A B I _ N A M E : " a r m e a b i " , " a r m e a b i - v 7 a " , " x 8 6 " , " m i p s " , " a r m 6 4 - v 8 a " , " x 8 6 _ 6 4 " , " m i p s 6 4 " d e p e n d i n g o n A N D R O I D _ A B I
# A N D R O I D _ N D K _ A B I _ N A M E : " a r m e a b i " , " a r m e a b i - v 7 a " , " a r m e a b i - v 7 a - h a r d " , " x 8 6 " , " m i p s " , " a r m 6 4 - v 8 a " , " x 8 6 _ 6 4 " , " m i p s 6 4 " d e p e n d i n g o n A N D R O I D _ A B I
# A N D R O I D _ N D K _ R E L E A S E : f r o m r 5 t o r 1 0 d ; s e t o n l y f o r N D K
# A N D R O I D _ N D K _ R E L E A S E _ N U M : n u m e r i c A N D R O I D _ N D K _ R E L E A S E version ( 1000*major+minor )
# A N D R O I D _ A R C H _ N A M E : " a r m " , " x 8 6 " , " m i p s " , " a r m 6 4 " , " x 8 6 _ 6 4 " , " m i p s 6 4 " d e p e n d i n g o n A N D R O I D _ A B I