|
|
|
@ -22,13 +22,8 @@ IF(NOT TARGET_CPU)
|
|
|
|
|
SET(TARGET_CPU "armv7")
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
SET(ARMV7_HARD_FLOAT OFF)
|
|
|
|
|
|
|
|
|
|
IF(TARGET_CPU STREQUAL "armv7")
|
|
|
|
|
SET(LIBRARY_ARCHITECTURE "armeabi-v7a")
|
|
|
|
|
IF(ARMV7_HARD_FLOAT)
|
|
|
|
|
SET(LIBRARY_ARCHITECTURE "${LIBRARY_ARCHITECTURE}-hard")
|
|
|
|
|
ENDIF()
|
|
|
|
|
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
|
|
|
|
|
SET(TOOLCHAIN_ARCH "arm")
|
|
|
|
|
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
|
|
|
|
@ -123,6 +118,12 @@ MACRO(SEARCH_TOOLCHAIN _COMPILER)
|
|
|
|
|
ENDFOREACH()
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
# try prefixes without version
|
|
|
|
|
SET(_TOOLCHAIN_WITHOUT_VERSION "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}")
|
|
|
|
|
IF(EXISTS ${_TOOLCHAIN_WITHOUT_VERSION})
|
|
|
|
|
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS "default")
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS)
|
|
|
|
|
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains")
|
|
|
|
|
ENDIF()
|
|
|
|
@ -136,7 +137,15 @@ MACRO(SEARCH_TOOLCHAIN _COMPILER)
|
|
|
|
|
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
|
|
|
|
|
MESSAGE(STATUS "TOOLCHAIN_PREFIX = ${${_COMPILER}_TOOLCHAIN_VERSION}")
|
|
|
|
|
|
|
|
|
|
IF("${${_COMPILER}_TOOLCHAIN_VERSION}" STREQUAL "default")
|
|
|
|
|
MESSAGE(STATUS "default")
|
|
|
|
|
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
|
|
|
|
|
ELSE()
|
|
|
|
|
MESSAGE(STATUS "not default")
|
|
|
|
|
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}")
|
|
|
|
|
FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*")
|
|
|
|
@ -192,7 +201,7 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
|
|
|
|
|
|
MACRO(SET_TOOLCHAIN_BINARY_LLVM _NAME _BINARY)
|
|
|
|
|
SET(${_NAME} ${CLANG_TOOLCHAIN_ROOT}/bin/${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE )
|
|
|
|
|
SET(${_NAME} ${CLANG_TOOLCHAIN_ROOT}/bin/${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE)
|
|
|
|
|
ENDMACRO()
|
|
|
|
|
|
|
|
|
|
MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY)
|
|
|
|
@ -214,6 +223,14 @@ IF(CLANG)
|
|
|
|
|
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as)
|
|
|
|
|
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
|
|
|
|
|
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++)
|
|
|
|
|
|
|
|
|
|
IF(NOT EXISTS "${CMAKE_ASM_COMPILER}")
|
|
|
|
|
SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as)
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
IF(NOT EXISTS "${CMAKE_AR}")
|
|
|
|
|
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
|
|
|
|
|
ENDIF()
|
|
|
|
|
ELSE()
|
|
|
|
|
MESSAGE(STATUS "Using GCC compiler")
|
|
|
|
|
|
|
|
|
|