@ -1,7 +1,37 @@
# Copyright ( c ) 2 0 1 0 - 2 0 1 1 , E t h a n R u b l e e
# Copyright ( c ) 2 0 1 1 - 2 0 1 2 , A n d r e y K a m a e v
# A l l r i g h t s r e s e r v e d .
#
# R e d i s t r i b u t i o n a n d u s e i n s o u r c e a n d b i n a r y f o r m s , w i t h o r w i t h o u t
# m o d i f i c a t i o n , a r e p e r m i t t e d p r o v i d e d t h a t t h e f o l l o w i n g c o n d i t i o n s a r e m e t :
#
# 1 . R e d i s t r i b u t i o n s o f s o u r c e c o d e m u s t r e t a i n t h e a b o v e c o p y r i g h t n o t i c e ,
# t h i s l i s t o f c o n d i t i o n s a n d t h e f o l l o w i n g d i s c l a i m e r .
#
# 2 . R e d i s t r i b u t i o n s i n b i n a r y f o r m m u s t r e p r o d u c e t h e a b o v e c o p y r i g h t n o t i c e ,
# t h i s l i s t o f c o n d i t i o n s a n d t h e f o l l o w i n g d i s c l a i m e r i n t h e d o c u m e n t a t i o n
# a n d / o r o t h e r m a t e r i a l s p r o v i d e d w i t h t h e d i s t r i b u t i o n .
#
# 3 . T h e n a m e o f t h e c o p y r i g h t h o l d e r s m a y b e u s e d t o e n d o r s e o r p r o m o t e
# p r o d u c t s d e r i v e d f r o m t h i s s o f t w a r e w i t h o u t s p e c i f i c p r i o r w r i t t e n
# p e r m i s s i o n .
#
# T H I S S O F T W A R E I S P R O V I D E D B Y T H E C O P Y R I G H T H O L D E R S A N D C O N T R I B U T O R S " A S I S "
# A N D A N Y E X P R E S S O R I M P L I E D W A R R A N T I E S , I N C L U D I N G , B U T N O T L I M I T E D T O , T H E
# I M P L I E D W A R R A N T I E S O F M E R C H A N T A B I L I T Y A N D F I T N E S S F O R A P A R T I C U L A R P U R P O S E
# A R E D I S C L A I M E D . I N N O E V E N T S H A L L T H E C O P Y R I G H T H O L D E R O R C O N T R I B U T O R S B E
# L I A B L E F O R A N Y D I R E C T , I N D I R E C T , I N C I D E N T A L , S P E C I A L , E X E M P L A R Y , O R
# C O N S E Q U E N T I A L DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# S U B S T I T U T E G O O D S O R S E R V I C E S ; L O S S O F U S E , D A T A , O R P R O F I T S ; O R B U S I N E S S
# I N T E R R U P T I O N ) H O W E V E R C A U S E D A N D O N A N Y T H E O R Y O F L I A B I L I T Y , W H E T H E R I N
# C O N T R A C T , S T R I C T L I A B I L I T Y , O R TORT ( INCLUDING NEGLIGENCE OR OTHERWISE )
# A R I S I N G I N A N Y W A Y O U T O F T H E U S E O F T H I S S O F T W A R E , E V E N I F A D V I S E D O F T H E
# P O S S I B I L I T Y O F S U C H D A M A G E .
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# A n d r o i d C M a k e t o o l c h a i n f i l e , f o r u s e w i t h t h e A n d r o i d N D K r 5 - r 8
# R e q u i r e s c m a k e 2 . 6 . 3 o r newer ( 2.8.5 or newer is recommended ) .
# S e e h o m e p a g e : h t t p : / / c o d e . g o o g l e . c o m / p / a n d r o i d - c m a k e /
# S e e h o m e p a g e : h t t p s : / / g i t h u b . c o m / t a k a - n o - m e / a n d r o i d - c m a k e
#
# T h e f i l e i s m a n t a i n e d b y t h e O p e n C V p r o j e c t . T h e l a t e s t v e r s i o n c a n b e g e t a t
# h t t p : / / c o d e . o p e n c v . o r g / p r o j e c t s / o p e n c v / r e p o s i t o r y / r e v i s i o n s / m a s t e r / c h a n g e s / a n d r o i d / a n d r o i d . t o o l c h a i n . c m a k e
@ -64,6 +94,20 @@
# A N D R O I D _ N A T I V E _ A P I _ L E V E L = a n d r o i d - 8 - l e v e l o f A n d r o i d A P I c o m p i l e f o r .
# O p t i o n i s r e a d - o n l y w h e n 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 _ T O O L C H A I N _ N A M E = a r m - l i n u x - a n d r o i d e a b i - 4 . 6 - t h e n a m e o f c o m p i l e r
# t o o l c h a i n t o b e u s e d . T h e l i s t o f p o s s i b l e v a l u e s d e p e n d s o n t h e N D K
# v e r s i o n . F o r N D K r 8 c t h e p o s s i b l e v a l u e s a r e :
#
# * a r m - l i n u x - a n d r o i d e a b i - 4 . 4 . 3
# * a r m - l i n u x - a n d r o i d e a b i - 4 . 6
# * a r m - l i n u x - a n d r o i d e a b i - c l a n g 3 . 1
# * m i p s e l - l i n u x - a n d r o i d - 4 . 4 . 3
# * m i p s e l - l i n u x - a n d r o i d - 4 . 6
# * m i p s e l - l i n u x - a n d r o i d - c l a n g 3 . 1
# * x 8 6 - 4 . 4 . 3
# * x 8 6 - 4 . 6
# * x 8 6 - c l a n g 3 . 1
#
# A N D R O I D _ F O R C E _ A R M _ B U I L D = O F F - s e t O N t o g e n e r a t e 3 2 - b i t A R M i n s t r u c t i o n s
# i n s t e a d o f T h u m b . I s n o t a v a i l a b l e f o r " x 8 6 " ( i n a p p l i c a b l e ) a n d
# " a r m e a b i - v 6 w i t h V F P " ( i s f o r c e d t o b e O N ) A B I s .
@ -147,13 +191,9 @@
# u n d e r t h e $ { L I B R A R Y _ O U T P U T _ P A T H _ R O O T } / l i b s / $ { A N D R O I D _ N D K _ A B I _ N A M E }
# ( d e p e n d i n g o n t h e t a r g e t A B I ) . T h i s i s c o n v e n i e n t f o r A n d r o i d p a c k a g i n g .
#
# A u t h o r s :
# E t h a n R u b l e e e t h a n . r u b l e @ g m a i l . c o m
# A n d r e y K a m a e v a n d r e y . k a m a e v @ i t s e e z . c o m
#
# C h a n g e L o g :
# - i n i t i a l v e r s i o n D e c e m b e r 2 0 1 0
# - m o d i f i e d A p r i l 2 0 1 1
# - A p r i l 2 0 1 1
# [ + ] a d d e d p o s s i b i l i t y t o b u i l d w i t h NDK ( without standalone toolchain )
# [ + ] s u p p o r t c r o s s - c o m p i l a t i o n o n Windows ( native, no cygwin support )
# [ + ] a d d e d c o m p i l e r o p t i o n t o f o r c e " c h a r " t y p e t o b e s i g n e d
@ -164,13 +204,13 @@
# [ + ] E X E C U T A B L E _ O U T P U T _ P A T H i s s e t b y toolchain ( required on Windows )
# [ ~ ] F i x e d b u g w i t h A N D R O I D _ A P I _ L E V E L v a r i a b l e
# [ ~ ] t u r n o f f S W I G s e a r c h i f i t i s n o t f o u n d f i r s t t i m e
# - m o d i f i e d M a y 2 0 1 1
# - M a y 2 0 1 1
# [ ~ ] A N D R O I D _ L E V E L i s r e n a m e d t o A N D R O I D _ A P I _ L E V E L
# [ + ] A N D R O I D _ A P I _ L E V E L i s d e t e c t e d b y t o o l c h a i n i f n o t s p e c i f i e d
# [ ~ ] a d d e d g u a r d t o p r e v e n t c h a n g i n g o f o u t p u t d i r e c t o r i e s o n t h e f i r s t
# c m a k e p a s s
# [ ~ ] t o o l c h a i n e x i t s w i t h e r r o r i f A R M _ T A R G E T i s n o t r e c o g n i z e d
# - m o d i f i e d J u n e 2 0 1 1
# - J u n e 2 0 1 1
# [ ~ ] d e f a u l t N D K p a t h i s u p d a t e d f o r v e r s i o n r 5 c
# [ + ] v a r i a b l e C M A K E _ S Y S T E M _ P R O C E S S O R i s s e t b a s e d o n A R M _ T A R G E T
# [ ~ ] t o o l c h a i n i n s t a l l d i r e c t o r y i s a d d e d t o l i n k e r p a t h s
@ -178,13 +218,13 @@
# [ + ] a d d e d m a c r o f i n d _ h o s t _ p a c k a g e , f i n d _ h o s t _ p r o g r a m t o s e a r c h
# p a c k a g e s / p r o g r a m s o n t h e h o s t s y s t e m
# [ ~ ] f i x e d p a t h t o S T L l i b r a r y
# - m o d i f i e d J u l y 2 0 1 1
# - J u l y 2 0 1 1
# [ ~ ] f i x e d o p t i o n s c a c h i n g
# [ ~ ] s e a r c h f o r a l l s u p p o r t e d N D K v e r s i o n s
# [ ~ ] a l l o w e d s p a c e s i n N D K p a t h
# - m o d i f i e d S e p t e m b e r 2 0 1 1
# - S e p t e m b e r 2 0 1 1
# [ ~ ] u p d a t e d f o r N D K r 6 b
# - m o d i f i e d N o v e m b e r 2 0 1 1
# - N o v e m b e r 2 0 1 1
# [ * ] r e w r i t t e n f o r N D K r 7
# [ + ] x 8 6 t o o l c h a i n support ( experimental )
# [ + ] a d d e d " a r m e a b i - v 6 w i t h V F P " A B I f o r A R M v 6 p r o c e s s o r s .
@ -197,37 +237,37 @@
# [ ~ ] A R M _ T A R G E T i s r e n a m e d t o A N D R O I D _ A B I
# [ ~ ] A R M E A B I _ N D K _ N A M E i s r e n a m e d t o A N D R O I D _ N D K _ A B I _ N A M E
# [ ~ ] A N D R O I D _ A P I _ L E V E L i s r e n a m e d t o A N D R O I D _ N A T I V E _ A P I _ L E V E L
# - m o d i f i e d J a n u a r y 2 0 1 2
# - J a n u a r y 2 0 1 2
# [ + ] a d d e d s t l p o r t _ s t a t i c support ( experimental )
# [ + ] a d d e d s p e c i a l c h e c k f o r c y g w i n
# [ + ] f i l t e r e d o u t h i d d e n files ( starting with . ) w h i l e g l o b b i n g i n s i d e N D K
# [ + ] a u t o m a t i c a l l y a p p l i e d G L E S v 2 l i n k a g e f i x f o r N D K r e v i s i o n s 5 - 6
# [ + ] a d d e d A N D R O I D _ G E T _ A B I _ R A W N A M E t o g e t N D K A B I n a m e s b y C M a k e f l a g s
# - m o d i f i e d F e b r u a r y 2 0 1 2
# - F e b r u a r y 2 0 1 2
# [ + ] u p d a t e d f o r N D K r 7 b
# [ ~ ] f i x e d c m a k e try_compile ( ) c o m m a n d
# [ ~ ] F i x f o r m i s s i n g i n s t a l l _ n a m e _ t o o l o n O S X
# - m o d i f i e d M a r c h 2 0 1 2
# - M a r c h 2 0 1 2
# [ ~ ] f i x e d i n c o r r e c t C c o m p i l e r f l a g s
# [ ~ ] f i x e d C M A K E _ S Y S T E M _ P R O C E S S O R c h a n g e o n A N D R O I D _ A B I c h a n g e
# [ + ] i m p r o v e d t o o l c h a i n l o a d i n g s p e e d
# [ + ] a d d e d a s s e m b l e r l a n g u a g e support ( .S )
# [ + ] a l l o w e d p r e s e t s e a r c h p a t h s a n d e x t r a s e a r c h s u f f i x e s
# - m o d i f i e d A p r i l 2 0 1 2
# - A p r i l 2 0 1 2
# [ + ] u p d a t e d f o r N D K r 7 c
# [ ~ ] f i x e d m o s t o f p r o b l e m s w i t h c o m p i l e r / l i n k e r f l a g s a n d c a c h i n g
# [ + ] a d d e d o p t i o n A N D R O I D _ F U N C T I O N _ L E V E L _ L I N K I N G
# - m o d i f i e d M a y 2 0 1 2
# - M a y 2 0 1 2
# [ + ] u p d a t e d f o r N D K r 8
# [ + ] a d d e d m i p s a r c h i t e c t u r e s u p p o r t
# - m o d i f i e d A u g u s t 2 0 1 2
# - A u g u s t 2 0 1 2
# [ + ] u p d a t e d f o r N D K r 8 b
# [ ~ ] a l l i n t e r m e d i a t e f i l e s g e n e r a t e d b y t o o l c h a i n a r e m o v e d t o C M a k e F i l e s
# [ ~ ] l i b s t d c + + a n d l i b s u p c a r e r e m o v e d f r o m e x p l i c i t l i n k l i b r a r i e s
# [ + ] a d d e d C C a c h e support ( via NDK_CCACHE environment or cmake variable )
# [ + ] a d d e d g o l d l i n k e r s u p p o r t f o r N D K r 8 b
# [ ~ ] f i x e d m i p s l i n k e r f l a g s f o r N D K r 8 b
# - m o d i f i e d S e p t e m b e r 2 0 1 2
# - S e p t e m b e r 2 0 1 2
# [ + ] a d d e d N D K r e l e a s e n a m e detection ( see ANDROID_NDK_RELEASE )
# [ + ] a d d e d s u p p o r t f o r a l l C + + r u n t i m e s f r o m N D K
# ( s y s t e m , g a b i + + , s t l p o r t , g n u s t l )
@ -235,8 +275,11 @@
# [ ~ ] u s e g o l d l i n k e r a s d e f a u l t i f available ( NDK r8b )
# [ ~ ] g l o b a l l y t u r n e d o f f r p a t h
# [ ~ ] c o m p i l e r o p t i o n s a r e a l i g n e d w i t h N D K r 8 b
# - m o d i f i e d O c t o b e r 2 0 1 2
# - O c t o b e r 2 0 1 2
# [ ~ ] f i x e d C + + l i n k i n g : e x p l i c i t l y l i n k w i t h m a t h library ( OpenCV # 2426 )
# - N o v e m b e r 2 0 1 2
# [ + ] u p d a t e d f o r N D K r 8 c
# [ + ] a d d e d s u p p o r t f o r c l a n g c o m p i l e r
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cmake_minimum_required ( VERSION 2.6.3 )
@ -259,7 +302,7 @@ set( CMAKE_SYSTEM_VERSION 1 )
# r p a t h m a k e s l o w s e n c e f o r A n d r o i d
set ( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )
set ( ANDROID_SUPPORTED_NDK_VERSIONS ${ ANDROID_EXTRA_NDK_VERSIONS } -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
set ( ANDROID_SUPPORTED_NDK_VERSIONS ${ ANDROID_EXTRA_NDK_VERSIONS } -r8c -r8 b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
if ( NOT DEFINED ANDROID_NDK_SEARCH_PATHS )
if ( CMAKE_HOST_WIN32 )
file ( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
@ -367,8 +410,8 @@ endmacro()
macro ( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )
if ( EXISTS "${_root}" )
file ( GLOB __gccExePath "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
__LIST_FILTER ( __gccExePath "bin/[.].*-gcc${TOOL_OS_SUFFIX}$ " )
file ( GLOB __gccExePath RELATIVE "${_root}/bin/" "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
__LIST_FILTER ( __gccExePath "^[.].* " )
list ( LENGTH __gccExePath __gccExePathsCount )
if ( NOT __gccExePathsCount EQUAL 1 AND NOT _CMAKE_IN_TRY_COMPILE )
message ( WARNING "Could not determine machine name for compiler from ${_root}" )
@ -506,55 +549,73 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN )
elseif ( __availableToolchainMachines MATCHES mipsel )
set ( __availableToolchainArchs "mipsel" )
endif ( )
if ( ANDROID_COMPILER_VERSION )
# d o n o t r u n g c c e v e r y t i m e b e c a u s e i t i s r e l a t e v e l y e x p e n c i v e
set ( __availableToolchainCompilerVersions "${ANDROID_COMPILER_VERSION}" )
else ( )
execute_process ( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" --version
O U T P U T _ V A R I A B L E _ _ a v a i l a b l e T o o l c h a i n C o m p i l e r V e r s i o n s O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
execute_process ( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" -dumpversion
O U T P U T _ V A R I A B L E _ _ a v a i l a b l e T o o l c h a i n C o m p i l e r V e r s i o n s O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
if ( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/bin/clang${TOOL_OS_SUFFIX}" )
list ( APPEND __availableToolchains "standalone-clang" )
list ( APPEND __availableToolchainMachines ${ __availableToolchainMachines } )
list ( APPEND __availableToolchainArchs ${ __availableToolchainArchs } )
list ( APPEND __availableToolchainCompilerVersions ${ __availableToolchainCompilerVersions } )
endif ( )
endif ( )
# g e t a l l t h e d e t a i l s a b o u t N D K
if ( BUILD_WITH_ANDROID_NDK )
file ( GLOB ANDROID_SUPPORTED_NATIVE_API_LEVELS RELATIVE "${ANDROID_NDK}/platforms" "${ANDROID_NDK}/platforms/android-*" )
string ( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
file ( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
__LIST_FILTER ( __availableToolchains "^[.]" )
set ( __availableToolchainMachines "" )
set ( __availableToolchainArchs "" )
set ( __availableToolchainCompilerVersions "" )
foreach ( __toolchain ${ __availableToolchains } )
__DETECT_TOOLCHAIN_MACHINE_NAME ( __machine "${ANDROID_NDK}/toolchains/${__toolchain}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
macro ( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar )
foreach ( __toolchain ${ ${__availableToolchainsVar } } )
if ( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK}/toolchains/${__toolchain}/prebuilt/" )
string ( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
else ( )
set ( __gcc_toolchain "${__toolchain}" )
endif ( )
__DETECT_TOOLCHAIN_MACHINE_NAME ( __machine "${ANDROID_NDK}/toolchains/${__gcc_toolchain}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
if ( __machine )
string ( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?$" __version "${__toolchain}" )
string ( REGEX MATCH "^[^-]+" __arch "${__toolchain}" )
string ( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?$" __version "${__gcc_toolchain}" )
string ( REGEX MATCH "^[^-]+" __arch "${__gcc_toolchain}" )
list ( APPEND __availableToolchainMachines "${__machine}" )
list ( APPEND __availableToolchainArchs "${__arch}" )
list ( APPEND __availableToolchainCompilerVersions "${__version}" )
else ( )
list ( REMOVE_ITEM __availableToolchains "${__toolchain}" )
list ( REMOVE_ITEM ${ __availableToolchainsVar } "${__toolchain}" )
endif ( )
unset ( __gcc_toolchain )
endforeach ( )
endmacro ( )
# g e t a l l t h e d e t a i l s a b o u t N D K
if ( BUILD_WITH_ANDROID_NDK )
file ( GLOB ANDROID_SUPPORTED_NATIVE_API_LEVELS RELATIVE "${ANDROID_NDK}/platforms" "${ANDROID_NDK}/platforms/android-*" )
string ( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
set ( __availableToolchains "" )
set ( __availableToolchainMachines "" )
set ( __availableToolchainArchs "" )
set ( __availableToolchainCompilerVersions "" )
if ( ANDROID_TOOLCHAIN_NAME AND EXISTS "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/" )
# d o n o t g o t h r o u g h a l l t o o l c h a i n s i f w e k n o w t h e n a m e
set ( __availableToolchains "${ANDROID_TOOLCHAIN_NAME}" )
__GLOB_NDK_TOOLCHAINS ( __availableToolchains )
endif ( )
if ( NOT __availableToolchains )
file ( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
__LIST_FILTER ( __availableToolchains "^[.]" )
__LIST_FILTER ( __availableToolchains "llvm" )
__GLOB_NDK_TOOLCHAINS ( __availableToolchains )
endif ( )
if ( NOT __availableToolchains )
message ( FATAL_ERROR "Could not any working toolchain in the NDK. Probably your Android NDK is broken." )
message ( FATAL_ERROR "Could not find any working toolchain in the NDK. Probably your Android NDK is broken." )
endif ( )
endif ( )
# b u i l d l i s t o f a v a i l a b l e A B I s
set ( ANDROID_SUPPORTED_ABIS "" )
set ( __uniqToolchainArchNames ${ __availableToolchainArchs } )
list ( REMOVE_DUPLICATES __uniqToolchainArchNames )
list ( SORT __uniqToolchainArchNames )
foreach ( __arch ${ __uniqToolchainArchNames } )
list ( APPEND ANDROID_SUPPORTED_ABIS ${ ANDROID_SUPPORTED_ABIS_${__arch } } )
endforeach ( )
unset ( __uniqToolchainArchNames )
if ( NOT ANDROID_SUPPORTED_ABIS )
set ( ANDROID_SUPPORTED_ABIS "" )
set ( __uniqToolchainArchNames ${ __availableToolchainArchs } )
list ( REMOVE_DUPLICATES __uniqToolchainArchNames )
list ( SORT __uniqToolchainArchNames )
foreach ( __arch ${ __uniqToolchainArchNames } )
list ( APPEND ANDROID_SUPPORTED_ABIS ${ ANDROID_SUPPORTED_ABIS_${__arch } } )
endforeach ( )
unset ( __uniqToolchainArchNames )
if ( NOT ANDROID_SUPPORTED_ABIS )
message ( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
endif ( )
message ( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
endif ( )
# c h o o s e t a r g e t A B I
@ -569,33 +630,34 @@ if( __androidAbiIdx EQUAL -1 )
endif ( )
unset ( __androidAbiIdx )
# r e m e m b e r t a r g e t A B I
set ( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE )
# s e t t a r g e t A B I o p t i o n s
if ( ANDROID_ABI STREQUAL "x86" )
set ( X86 true )
set ( ANDROID_NDK_ABI_NAME "x86" )
set ( ANDROID_ARCH_NAME "x86" )
set ( ANDROID_ARCH_FULLNAME "x86" )
set ( ANDROID_LLVM_TRIPLE "i686-none-linux-android" )
set ( CMAKE_SYSTEM_PROCESSOR "i686" )
elseif ( ANDROID_ABI STREQUAL "mips" )
set ( MIPS true )
set ( ANDROID_NDK_ABI_NAME "mips" )
set ( ANDROID_ARCH_NAME "mips" )
set ( ANDROID_ARCH_FULLNAME "mipsel" )
set ( ANDROID_LLVM_TRIPLE "mipsel-none-linux-android" )
set ( CMAKE_SYSTEM_PROCESSOR "mips" )
elseif ( ANDROID_ABI STREQUAL "armeabi" )
set ( ARMEABI true )
set ( ANDROID_NDK_ABI_NAME "armeabi" )
set ( ANDROID_ARCH_NAME "arm" )
set ( ANDROID_ARCH_FULLNAME "arm" )
set ( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
set ( CMAKE_SYSTEM_PROCESSOR "armv5te" )
elseif ( ANDROID_ABI STREQUAL "armeabi-v6 with VFP" )
set ( ARMEABI_V6 true )
set ( ANDROID_NDK_ABI_NAME "armeabi" )
set ( ANDROID_ARCH_NAME "arm" )
set ( ANDROID_ARCH_FULLNAME "arm" )
set ( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
set ( CMAKE_SYSTEM_PROCESSOR "armv6" )
# n e e d a l w a y s f a l l b a c k t o o l d e r p l a t f o r m
set ( ARMEABI true )
@ -604,12 +666,14 @@ elseif( ANDROID_ABI STREQUAL "armeabi-v7a")
set ( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
set ( ANDROID_ARCH_NAME "arm" )
set ( ANDROID_ARCH_FULLNAME "arm" )
set ( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
set ( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
elseif ( ANDROID_ABI STREQUAL "armeabi-v7a with VFPV3" )
set ( ARMEABI_V7A true )
set ( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
set ( ANDROID_ARCH_NAME "arm" )
set ( ANDROID_ARCH_FULLNAME "arm" )
set ( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
set ( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
set ( VFPV3 true )
elseif ( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" )
@ -617,6 +681,7 @@ elseif( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" )
set ( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
set ( ANDROID_ARCH_NAME "arm" )
set ( ANDROID_ARCH_FULLNAME "arm" )
set ( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
set ( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
set ( VFPV3 true )
set ( NEON true )
@ -630,12 +695,6 @@ if( CMAKE_BINARY_DIR AND EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMa
file ( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \" ${ CMAKE_SYSTEM_PROCESSOR } \")\n" )
endif ( )
set ( ANDROID_SUPPORTED_ABIS ${ ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME } } CACHE INTERNAL "ANDROID_ABI can be changed only to one of these ABIs. Changing to any other ABI requires to reset cmake cache." FORCE )
if ( CMAKE_VERSION VERSION_GREATER "2.8" )
list ( SORT ANDROID_SUPPORTED_ABIS_ ${ ANDROID_ARCH_FULLNAME } )
set_property ( CACHE ANDROID_ABI PROPERTY STRINGS ${ ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME } } )
endif ( )
if ( ANDROID_ARCH_NAME STREQUAL "arm" AND NOT ARMEABI_V6 )
__INIT_VARIABLE ( ANDROID_FORCE_ARM_BUILD OBSOLETE_FORCE_ARM VALUES OFF )
set ( ANDROID_FORCE_ARM_BUILD ${ ANDROID_FORCE_ARM_BUILD } CACHE BOOL "Use 32-bit ARM instructions instead of Thumb-1" FORCE )
@ -648,11 +707,15 @@ endif()
if ( ANDROID_TOOLCHAIN_NAME )
list ( FIND __availableToolchains "${ANDROID_TOOLCHAIN_NAME}" __toolchainIdx )
if ( __toolchainIdx EQUAL -1 )
message ( FATAL_ERROR "Previously selected toolchain \" ${ ANDROID_TOOLCHAIN_NAME } \" is missing. You need to remove CMakeCache.txt and rerun cmake manually to change the toolchain " )
list ( SORT __availableToolchains )
string ( REPLACE ";" "\n * " toolchains_list "${__availableToolchains}" )
set ( toolchains_list " * ${toolchains_list}" )
message ( FATAL_ERROR "Specified toolchain \" ${ ANDROID_TOOLCHAIN_NAME } \" is missing in your NDK or broken. Please verify that your NDK is working or select another compiler toolchain.
T o c o n f i g u r e t h e t o o l c h a i n s e t C M a k e v a r i a b l e A N D R O I D _ T O O L C H A I N _ N A M E t o o n e o f t h e f o l l o w i n g v a l u e s : \ n $ { t o o l c h a i n s _ l i s t } \ n " )
endif ( )
list ( GET __availableToolchainArchs ${ __toolchainIdx } __toolchainArch )
if ( NOT __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )
message ( SEND_ERROR "Previously selected toolchain \" ${ ANDROID_TOOLCHAIN_NAME } \" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform. " )
message ( SEND_ERROR "S elected toolchain \" ${ ANDROID_TOOLCHAIN_NAME } \" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform. " )
endif ( )
else ( )
set ( __toolchainIdx -1 )
@ -681,8 +744,7 @@ endif()
list ( GET __availableToolchains ${ __toolchainIdx } ANDROID_TOOLCHAIN_NAME )
list ( GET __availableToolchainMachines ${ __toolchainIdx } ANDROID_TOOLCHAIN_MACHINE_NAME )
list ( GET __availableToolchainCompilerVersions ${ __toolchainIdx } ANDROID_COMPILER_VERSION )
set ( ANDROID_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" CACHE INTERNAL "Name of toolchain used" FORCE )
set ( ANDROID_COMPILER_VERSION "${ANDROID_COMPILER_VERSION}" CACHE INTERNAL "compiler version from selected toolchain" FORCE )
unset ( __toolchainIdx )
unset ( __availableToolchains )
unset ( __availableToolchainMachines )
@ -692,38 +754,36 @@ unset( __availableToolchainCompilerVersions )
# c h o o s e n a t i v e A P I l e v e l
__INIT_VARIABLE ( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_ ${ ANDROID_ARCH_NAME } ANDROID_DEFAULT_NDK_API_LEVEL )
string ( REGEX MATCH "[0-9]+" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
# T O D O : f i l t e r o u t u n s u p p o r t e d l e v e l s
# v a l i d a t e
list ( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_NATIVE_API_LEVEL}" __levelIdx )
if ( __levelIdx EQUAL -1 )
message ( SEND_ERROR "Specified Android native API level (${ANDROID_NATIVE_API_LEVEL}) is not supported by your NDK/toolchain." )
endif ( )
unset ( __levelIdx )
if ( BUILD_WITH_ANDROID_NDK )
__DETECT_NATIVE_API_LEVEL ( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
if ( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL )
message ( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
else ( )
if ( BUILD_WITH_ANDROID_NDK )
__DETECT_NATIVE_API_LEVEL ( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
if ( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL )
message ( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
endif ( )
unset ( __realApiLevel )
endif ( )
set ( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE )
if ( CMAKE_VERSION VERSION_GREATER "2.8" )
list ( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )
set_property ( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ ANDROID_SUPPORTED_NATIVE_API_LEVELS } )
endif ( )
unset ( __realApiLevel )
endif ( )
set ( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE )
if ( CMAKE_VERSION VERSION_GREATER "2.8" )
list ( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )
set_property ( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ ANDROID_SUPPORTED_NATIVE_API_LEVELS } )
endif ( )
unset ( __levelIdx )
# s e t u p o u t p u t d i r e c t o r i e s
set ( LIBRARY_OUTPUT_PATH_ROOT ${ CMAKE_SOURCE_DIR } CACHE PATH "root for library output, set this to change where android libs are installed to" )
set ( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
if ( NOT _CMAKE_IN_TRY_COMPILE )
if ( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
set ( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
else ( )
set ( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
endif ( )
set ( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
# r e m e m b e r t a r g e t A B I
set ( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE )
if ( CMAKE_VERSION VERSION_GREATER "2.8" )
list ( SORT ANDROID_SUPPORTED_ABIS_ ${ ANDROID_ARCH_FULLNAME } )
set_property ( CACHE ANDROID_ABI PROPERTY STRINGS ${ ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME } } )
endif ( )
# r u n t i m e choice ( STL, rtti, exceptions )
if ( NOT ANDROID_STL )
# h o n o r l e g a c y A N D R O I D _ U S E _ S T L P O R T
@ -800,9 +860,84 @@ See https://android.googlesource.com/platform/development.git f907f4f9d4e56ccc80
" )
endif ( )
# s e t u p p a t h s a n d S T L f o r s t a n d a l o n e t o o l c h a i n
if ( BUILD_WITH_STANDALONE_TOOLCHAIN )
set ( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
set ( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
set ( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )
if ( NOT ANDROID_STL STREQUAL "none" )
set ( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
if ( ARMEABI_V7A 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" )
else ( )
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" )
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" )
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" )
elseif ( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libstdc++.a" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )
endif ( )
if ( __libstl )
set ( __libsupcxx "${__libstl}/libsupc++.a" )
set ( __libstl "${__libstl}/libstdc++.a" )
endif ( )
if ( NOT EXISTS "${__libsupcxx}" )
message ( FATAL_ERROR " The required libstdsupc++.a is missing in your standalone toolchain.
U s u a l l y i t h a p p e n s b e c a u s e o f b u g i n m a k e - s t a n d a l o n e - t o o l c h a i n . s h s c r i p t f r o m N D K r 7 , r 7 b a n d r 7 c .
Y o u n e e d t o e i t h e r u p g r a d e t o n e w e r N D K o r m a n u a l l y c o p y
$ A N D R O I D _ N D K / s o u r c e s / c x x - s t l / g n u - l i b s t d c + + / l i b s / $ { A N D R O I D _ N D K _ A B I _ N A M E } / l i b s u p c + + . a
t o
$ { _ _ l i b s u p c x x }
" )
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" )
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" )
elseif ( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
endif ( )
endif ( )
endif ( )
endif ( )
# c l a n g
if ( "${ANDROID_TOOLCHAIN_NAME}" STREQUAL "standalone-clang" )
set ( ANDROID_COMPILER_IS_CLANG 1 )
execute_process ( COMMAND "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/clang${TOOL_OS_SUFFIX}" --version OUTPUT_VARIABLE ANDROID_CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )
string ( REGEX MATCH "[0-9]+[.][0-9]+" ANDROID_CLANG_VERSION "${ANDROID_CLANG_VERSION}" )
elseif ( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang3[.][0-9]?$" )
string ( REGEX MATCH "3[.][0-9]$" ANDROID_CLANG_VERSION "${ANDROID_TOOLCHAIN_NAME}" )
string ( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-4.6" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
if ( NOT EXISTS "${ANDROID_NDK}/toolchains/llvm-${ANDROID_CLANG_VERSION}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/bin/clang${TOOL_OS_SUFFIX}" )
message ( FATAL_ERROR "Could not find the " )
endif ( )
set ( ANDROID_COMPILER_IS_CLANG 1 )
set ( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/llvm-${ANDROID_CLANG_VERSION}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
else ( )
set ( ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
unset ( ANDROID_COMPILER_IS_CLANG CACHE )
endif ( )
string ( REPLACE "." "" _clang_name "clang${ANDROID_CLANG_VERSION}" )
if ( NOT EXISTS "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" )
set ( _clang_name "clang" )
endif ( )
# s e t u p p a t h s a n d S T L f o r N D K
if ( BUILD_WITH_ANDROID_NDK )
set ( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
set ( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_GCC_ TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
set ( ANDROID_SYSROOT "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}" )
if ( ANDROID_STL STREQUAL "none" )
@ -874,54 +1009,6 @@ if( BUILD_WITH_ANDROID_NDK )
endif ( )
endif ( )
# s e t u p p a t h s a n d S T L f o r s t a n d a l o n e t o o l c h a i n
if ( BUILD_WITH_STANDALONE_TOOLCHAIN )
set ( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
set ( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )
if ( NOT ANDROID_STL STREQUAL "none" )
set ( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
if ( ARMEABI_V7A 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" )
else ( )
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" )
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" )
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" )
elseif ( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libstdc++.a" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )
endif ( )
if ( __libstl )
set ( __libsupcxx "${__libstl}/libsupc++.a" )
set ( __libstl "${__libstl}/libstdc++.a" )
endif ( )
if ( NOT EXISTS "${__libsupcxx}" )
message ( FATAL_ERROR " The required libstdsupc++.a is missing in your standalone toolchain.
U s u a l l y i t h a p p e n s b e c a u s e o f b u g i n m a k e - s t a n d a l o n e - t o o l c h a i n . s h s c r i p t f r o m N D K r 7 , r 7 b a n d r 7 c .
Y o u n e e d t o e i t h e r u p g r a d e t o n e w e r N D K o r m a n u a l l y c o p y
$ A N D R O I D _ N D K / s o u r c e s / c x x - s t l / g n u - l i b s t d c + + / l i b s / $ { A N D R O I D _ N D K _ A B I _ N A M E } / l i b s u p c + + . a
t o
$ { _ _ l i b s u p c x x }
" )
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" )
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" )
elseif ( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
set ( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
endif ( )
endif ( )
endif ( )
endif ( )
# c a s e o f s h a r e d S T L l i n k a g e
if ( ANDROID_STL MATCHES "shared" AND DEFINED __libstl )
@ -937,6 +1024,7 @@ if( ANDROID_STL MATCHES "shared" AND DEFINED __libstl )
endif ( )
endif ( )
# c c a c h e s u p p o r t
__INIT_VARIABLE ( _ndk_ccache NDK_CCACHE ENV_NDK_CCACHE )
if ( _ndk_ccache )
@ -946,16 +1034,27 @@ else()
endif ( )
unset ( _ndk_ccache )
# s e t u p t h e c r o s s - c o m p i l e r
if ( NOT CMAKE_C_COMPILER )
if ( NDK_CCACHE )
set ( CMAKE_C_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C compiler" )
set ( CMAKE_CXX_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C++ compiler" )
set ( CMAKE_C_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "gcc" )
set ( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "g++" )
if ( ANDROID_COMPILER_IS_CLANG )
set ( CMAKE_C_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler" )
set ( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler" )
else ( )
set ( CMAKE_C_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler" )
set ( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler" )
endif ( )
else ( )
set ( CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "gcc" )
set ( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "g++" )
if ( ANDROID_COMPILER_IS_CLANG )
set ( CMAKE_C_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler" )
set ( CMAKE_CXX_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler" )
else ( )
set ( CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler" )
set ( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler" )
endif ( )
endif ( )
set ( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "assembler" )
set ( CMAKE_STRIP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}" CACHE PATH "strip" )
@ -982,15 +1081,22 @@ endif()
# F o r c e s e t c o m p i l e r s b e c a u s e s t a n d a r d i d e n t i f i c a t i o n w o r k s b a d l y f o r u s
include ( CMakeForceCompiler )
CMAKE_FORCE_C_COMPILER ( "${CMAKE_C_COMPILER}" GNU )
if ( ANDROID_COMPILER_IS_CLANG )
set ( CMAKE_C_COMPILER_ID Clang )
endif ( )
set ( CMAKE_C_PLATFORM_ID Linux )
set ( CMAKE_C_SIZEOF_DATA_PTR 4 )
set ( CMAKE_C_HAS_ISYSROOT 1 )
set ( CMAKE_C_COMPILER_ABI ELF )
CMAKE_FORCE_CXX_COMPILER ( "${CMAKE_CXX_COMPILER}" GNU )
if ( ANDROID_COMPILER_IS_CLANG )
set ( CMAKE_CXX_COMPILER_ID Clang )
endif ( )
set ( CMAKE_CXX_PLATFORM_ID Linux )
set ( CMAKE_CXX_SIZEOF_DATA_PTR 4 )
set ( CMAKE_CXX_HAS_ISYSROOT 1 )
set ( CMAKE_CXX_COMPILER_ABI ELF )
set ( CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc cp cxx cpp CPP c++ C )
# f o r c e A S M compiler ( required for CMake < 2.8.5 )
set ( CMAKE_ASM_COMPILER_ID_RUN TRUE )
set ( CMAKE_ASM_COMPILER_ID GNU )
@ -1056,10 +1162,10 @@ if( ARMEABI_V7A )
elseif ( VFPV3 )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3" )
else ( )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfp" )
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" )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp" ) # v f p = = v f p v 2
elseif ( ARMEABI )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv5te -mtune=xscale -msoft-float" )
endif ( )
@ -1148,17 +1254,25 @@ if( ANDROID_FUNCTION_LEVEL_LINKING )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" )
endif ( )
if ( ANDROID_GOLD_LINKER AND CMAKE_HOST_UNIX AND ( ARMEABI OR ARMEABI_V7A OR X86 ) AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
elseif ( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" AND NOT _CMAKE_IN_TRY_COMPILE )
message ( WARNING " The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342
if ( ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
if ( ANDROID_GOLD_LINKER AND ( CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE STRGREATER "r8b" ) AND ( ARMEABI OR ARMEABI_V7A OR X86 ) )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
elseif ( ANDROID_NDK_RELEASE STREQUAL "r8c" )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=bfd" )
elseif ( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND NOT _CMAKE_IN_TRY_COMPILE )
message ( WARNING " The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342
O n L i n u x a n d O S X h o s t p l a t f o r m y o u c a n w o r k a r o u n d t h i s p r o b l e m u s i n g g o l d linker ( default ) .
R e r u n c m a k e w i t h - D A N D R O I D _ G O L D _ L I N K E R = O N o p t i o n .
R e r u n c m a k e w i t h - D A N D R O I D _ G O L D _ L I N K E R = O N o p t i o n i n c a s e o f p r o b l e m s .
" )
endif ( )
endif ( )
endif ( ) # v e r s i o n 4 . 6
if ( ANDROID_NOEXECSTACK )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Wa,--noexecstack" )
if ( ANDROID_COMPILER_IS_CLANG )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Xclang -mnoexecstack" )
else ( )
set ( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Wa,--noexecstack" )
endif ( )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,noexecstack" )
endif ( )
@ -1166,6 +1280,22 @@ if( ANDROID_RELRO )
set ( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now" )
endif ( )
if ( ANDROID_COMPILER_IS_CLANG )
set ( ANDROID_CXX_FLAGS "-Qunused-arguments ${ANDROID_CXX_FLAGS}" )
if ( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD )
set ( ANDROID_CXX_FLAGS_RELEASE "-target thumbv7-none-linux-androideabi ${ANDROID_CXX_FLAGS_RELEASE}" )
set ( ANDROID_CXX_FLAGS_DEBUG "-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS_DEBUG}" )
else ( )
set ( ANDROID_CXX_FLAGS "-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS}" )
endif ( )
if ( BUILD_WITH_ANDROID_NDK )
if ( ANDROID_ARCH_NAME STREQUAL "arm" )
set ( ANDROID_CXX_FLAGS "-isystem ${ANDROID_CLANG_TOOLCHAIN_ROOT}/lib/clang/${ANDROID_CLANG_VERSION}/include ${ANDROID_CXX_FLAGS}" )
endif ( )
set ( ANDROID_CXX_FLAGS "-gcc-toolchain ${ANDROID_TOOLCHAIN_ROOT} ${ANDROID_CXX_FLAGS}" )
endif ( )
endif ( )
# c a c h e f l a g s
set ( CMAKE_CXX_FLAGS "" CACHE STRING "c++ flags" )
set ( CMAKE_C_FLAGS "" CACHE STRING "c flags" )
@ -1189,9 +1319,9 @@ set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FL
set ( CMAKE_EXE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
if ( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK_RELEASE STREQUAL "r8" )
set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}" )
set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}" )
set ( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}" )
set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_GCC_ TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}" )
set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_GCC_ TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}" )
set ( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_GCC_ TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}" )
endif ( )
# c o n f i g u r e r t t i
@ -1218,6 +1348,19 @@ endif()
include_directories ( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ ANDROID_STL_INCLUDE_DIRS } )
link_directories ( "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" )
# s e t u p o u t p u t d i r e c t o r i e s
set ( LIBRARY_OUTPUT_PATH_ROOT ${ CMAKE_SOURCE_DIR } CACHE PATH "root for library output, set this to change where android libs are installed to" )
set ( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
if ( NOT _CMAKE_IN_TRY_COMPILE )
if ( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
set ( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
else ( )
set ( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
endif ( )
set ( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
endif ( )
# s e t t h e s e g l o b a l f l a g s f o r c m a k e c l i e n t s c r i p t s t o c h a n g e b e h a v i o r
set ( ANDROID True )
set ( BUILD_ANDROID True )
@ -1335,7 +1478,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 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 , 14 ( depends on NDK version )
# A N D R O I D _ S E T _ O B S O L E T E _ V A R I A B L E S : O N / O F F
# 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
# A N D R O I D _ N O _ U N D E F I N E D : O N / O F F
# A N D R O I D _ S O _ U N D E F I N E D : O F F / ON ( default depends on NDK version )
@ -1343,16 +1486,15 @@ endif()
# A N D R O I D _ G O L D _ L I N K E R : O N / O F F
# A N D R O I D _ N O E X E C S T A C K : O N / O F F
# A N D R O I D _ R E L R O : O N / O F F
# V a r i a b l e s t h a t t a k e s e f f e c t o n l y a t f i r s t r u n :
# A N D R O I D _ F O R C E _ A R M _ B U I L D : O N / O F F
# 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 _ S T L _ F O R C E _ F E A T U R E S : O N / O F F
# L I B R A R Y _ O U T P U T _ P A T H _ R O O T : < a n y v a l i d p a t h >
# N D K _ C C A C H E : < p a t h t o y o u r c c a c h e e x e c u t a b l e >
# A N D R O I D _ S E T _ O B S O L E T E _ V A R I A B L E S : O N / O F F
# C a n b e s e t o n l y a t t h e f i r s t r u n :
# A N D R O I D _ N D K
# A N D R O I D _ S T A N D A L O N E _ T O O L C H A I N
# A N D R O I D _ T O O L C H A I N _ N A M E : " a r m - l i n u x - a n d r o i d e a b i - 4 . 4 . 3 " o r " a r m - l i n u x - a n d r o i d e a b i - 4 . 6 " o r " m i p s e l - l i n u x - a n d r o i d - 4 . 4 . 3 " o r " m i p s e l - l i n u x - a n d r o i d - 4 . 6 " o r " x 8 6 - 4 . 4 . 3 " o r " x 8 6 - 4 . 6 "
# A N D R O I D _ T O O L C H A I N _ N A M E : t h e N D K n a m e o f c o m p i l e r t o o l c h a i n
# L I B R A R Y _ O U T P U T _ P A T H _ R O O T : < a n y v a l i d p a t h >
# N D K _ C C A C H E : < p a t h t o y o u r c c a c h e e x e c u t a b l e >
# O b s o l e t e :
# A N D R O I D _ A P I _ L E V E L : s u p e r s e d e d b y A N D R O I D _ N A T I V E _ A P I _ L E V E L
# A R M _ T A R G E T : s u p e r s e d e d b y A N D R O I D _ A B I
@ -1375,10 +1517,11 @@ endif()
# 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 " o r " m i p s " 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 : o n e o f r 5 , r 5 b , r 5 c , r 6 , r 6 b , r 7 , r 7 b , r 7 c , r 8 , r 8 b ; 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 : o n e o f r 5 , r 5 b , r 5 c , r 6 , r 6 b , r 7 , r 7 b , r 7 c , r 8 , r 8 b , r 8 c ; s e t o n l y f o r N D K
# A N D R O I D _ A R C H _ N A M E : " a r m " o r " x 8 6 " o r " m i p s " 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 _ S Y S R O O T : p a t h t o t h e c o m p i l e r s y s r o o t
# T O O L _ O S _ S U F F I X : " " o r " . e x e " 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 _ C O M P I L E R _ I S _ C L A N G : T R U E i f c l a n g c o m p i l e r i s u s e d
# O b s o l e t e :
# A R M E A B I _ N D K _ N A M E : s u p e r s e d e d b y A N D R O I D _ N D K _ A B I _ N A M E
#
@ -1388,10 +1531,13 @@ endif()
# A N D R O I D _ S U P P O R T E D _ A B I S : l i s t o f c u r r e n t l y a l l o w e d v a l u e s f o r A N D R O I D _ A B I
# A N D R O I D _ T O O L C H A I N _ M A C H I N E _ N A M E : " a r m - l i n u x - a n d r o i d e a b i " , " a r m - e a b i " o r " i 6 8 6 - a n d r o i d - l i n u x "
# A N D R O I D _ T O O L C H A I N _ R O O T : p a t h t o t h e t o p l e v e l o f toolchain ( standalone or placed inside NDK )
# A N D R O I D _ C L A N G _ T O O L C H A I N _ R O O T : p a t h t o c l a n g t o o l s
# A N D R O I D _ S U P P O R T E D _ N A T I V E _ A P I _ L E V E L S : l i s t o f n a t i v e A P I l e v e l s f o u n d i n s i d e N D K
# A N D R O I D _ S T L _ I N C L U D E _ D I R S : s t l i n c l u d e p a t h s
# A N D R O I D _ R T T I : i f r t t i i s e n a b l e d b y t h e r u n t i m e
# A N D R O I D _ E X C E P T I O N S : i f e x c e p t i o n s a r e e n a b l e d b y t h e r u n t i m e
# A N D R O I D _ G C C _ T O O L C H A I N _ N A M E : r e a d - o n l y , d i f f e r s f r o m A N D R O I D _ T O O L C H A I N _ N A M E o n l y i f c l a n g i s u s e d
# A N D R O I D _ C L A N G _ V E R S I O N : v e r s i o n o f c l a n g c o m p i l e r i f c l a n g i s u s e d
#
# D e f a u l t s :
# A N D R O I D _ D E F A U L T _ N D K _ A P I _ L E V E L