-
Notifications
You must be signed in to change notification settings - Fork 5
/
a2_toolchain.txt
86 lines (63 loc) · 3.51 KB
/
a2_toolchain.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# this is just groundwork, to be implemented...
set( ANDROID_STL_OPTIONS "gnu-libstdc++" CACHE STRING "Set build type")
set_property( CACHE ANDROID_STL_OPTIONS PROPERTY STRINGS gnu-libstdc++ stlport )
# this is used for with gcc STL
set( ANDROID_TARGET_CPU "armeabi" CACHE STRING "Set target CPU type")
set_property( CACHE ANDROID_TARGET_CPU PROPERTY STRINGS armeabi armeabi-v7 mips x86 )
SET(CMAKE_SYSTEM_NAME Android)
SET(CMAKE_SYSTEM_VERSION 1)
set( ANDROID_SDK_VERSION_NUMBER 8 )
set( ANDROID_NDK_TARGET_PLATFORM 14 )
set( ANDROID_NDK_VERSION android-ndk-r9 CACHE STRING "NDK Version (appended to another path)" )
set( ANDROID_SDK_ROOT $ENV{ANDROID_HOME} CACHE PATH "Android root path" )
set( ANDROID_NDK_PREBUILT_VERSION 4.8 )
set( ANDROID_NDK_PREBUILT_ARCH_LONG arm-linux-androideabi )
set( ANDROID_NDK_PREBUILT_ARCH thumb )
set( ANDROID_NDK_PREBUILT ${ANDROID_NDK_PREBUILT_ARCH_LONG}-${ANDROID_NDK_PREBUILT_VERSION} )
macro( DEFINE_DEFAULT variable default )
if( NOT DEFINED ${variable} )
set( ${variable} $ENV{${variable}} )
if( "${${variable}}" STREQUAL "" )
set( ${variable} ${default} )
endif( "${${variable}}" STREQUAL "" )
endif( NOT DEFINED ${variable} )
endmacro( DEFINE_DEFAULT variable )
DEFINE_DEFAULT( ANDROID_DIR c:/storage/android/${ANDROID_NDK_VERSION} )
SET(ANDROID_DIR ${ANDROID_DIR} CACHE PATH "NDK Root" )
set( SYSROOT ${ANDROID_DIR}/platforms/android-${ANDROID_NDK_TARGET_PLATFORM}/arch-arm )
set(ENV{SYSROOT} ${SYSROOT} )
SET(ANDROID_NDK_DIR ${ANDROID_DIR}/toolchains )
SET(ANDROID_WINVER windows )
SET(STAGING_DIR ${ANDROID_NDK_DIR}/arm-linux-androideabi-${ANDROID_NDK_PREBUILT_VERSION}/prebuilt/${ANDROID_WINVER})
SET(TARGET_CC ${STAGING_DIR}/bin/arm-linux-androideabi-gcc.exe --sysroot=${SYSROOT})
SET(TARGET_CXX ${STAGING_DIR}/bin/arm-linux-androideabi-c++.exe --sysroot=${SYSROOT})
message( ${TARGET_CC} )
message( ${STAGING_DIR} )
message( ${ANDROID_NDK_DIR} )
set( CMAKE_C_COMPILER_WORKS 1 )
set( CMAKE_CXX_COMPILER_WORKS 1 )
SET(CMAKE_SYSTEM_PROCESSOR arm-elf)
SET(CMAKE_C_COMPILER ${TARGET_CC})
SET(CMAKE_CXX_COMPILER ${TARGET_CXX})
set(CMAKE_C_COMPILER_FORCED 1 )
set(CMAKE_CXX_COMPILER_FORCED 1)
set(CMAKE_REQUIRED_INCLUDES ${ANDROID_DIR}/platforms/android-${ANDROID_NDK_TARGET_PLATFORM}/arch-arm/usr/include )
include_directories( ${ANDROID_DIR}/platforms/android-${ANDROID_NDK_TARGET_PLATFORM}/arch-arm/usr/include )
include_directories( ${ANDROID_DIR}/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_PREBUILT_VERSION}/include )
include_directories( ${ANDROID_DIR}/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_PREBUILT_VERSION}/libs/${ANDROID_TARGET_CPU}/include )
LINK_DIRECTORIES( ${ANDROID_DIR}/platforms/android-${ANDROID_NDK_TARGET_PLATFORM}/arch-arm/usr/lib )
LINK_DIRECTORIES( ${ANDROID_DIR}/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_PREBUILT_VERSION}/libs/${ANDROID_TARGET_CPU} )
#SET( CMAKE_EXE_LINKER_FLAGS "-lstdc++ -lsupc++ -lgnustl_shared" )
#SET( CMAKE_SHARED_LINKER_FLAGS "-lstdc++ -lsupc++ -lgnustl_shared" )
#SET( CMAKE_MODULE_LINKER_FLAGS "-lstdc++ -lsupc++ -lgnustl_shared" )
SET( CMAKE_EXE_LINKER_FLAGS "-lstdc++ -lgnustl_static" )
SET( CMAKE_SHARED_LINKER_FLAGS "-lstdc++ -lgnustl_static" )
SET( CMAKE_MODULE_LINKER_FLAGS "-lstdc++ -lgnustl_static" )
SET(CMAKE_FIND_ROOT_PATH ${ANDROID_DIR})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_MAKE_PROGRAM make.exe )
set(CMAKE_C_COMPILER_ENV_VAR x)