|
|
@ -22,13 +22,8 @@ IF(NOT TARGET_CPU)
|
|
|
|
SET(TARGET_CPU "armv7")
|
|
|
|
SET(TARGET_CPU "armv7")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
SET(ARMV7_HARD_FLOAT OFF)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_CPU STREQUAL "armv7")
|
|
|
|
IF(TARGET_CPU STREQUAL "armv7")
|
|
|
|
SET(LIBRARY_ARCHITECTURE "armeabi-v7a")
|
|
|
|
SET(LIBRARY_ARCHITECTURE "armeabi-v7a")
|
|
|
|
IF(ARMV7_HARD_FLOAT)
|
|
|
|
|
|
|
|
SET(LIBRARY_ARCHITECTURE "${LIBRARY_ARCHITECTURE}-hard")
|
|
|
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
|
|
|
|
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
|
|
|
|
SET(TOOLCHAIN_ARCH "arm")
|
|
|
|
SET(TOOLCHAIN_ARCH "arm")
|
|
|
|
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
|
|
|
|
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
|
|
|
@ -123,6 +118,12 @@ MACRO(SEARCH_TOOLCHAIN _COMPILER)
|
|
|
|
ENDFOREACH()
|
|
|
|
ENDFOREACH()
|
|
|
|
ENDIF()
|
|
|
|
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)
|
|
|
|
IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS)
|
|
|
|
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains")
|
|
|
|
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
@ -136,7 +137,15 @@ MACRO(SEARCH_TOOLCHAIN _COMPILER)
|
|
|
|
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
|
|
|
|
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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}")
|
|
|
|
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
|
|
|
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}")
|
|
|
|
IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}")
|
|
|
|
FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*")
|
|
|
|
FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*")
|
|
|
@ -214,6 +223,14 @@ IF(CLANG)
|
|
|
|
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as)
|
|
|
|
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as)
|
|
|
|
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
|
|
|
|
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
|
|
|
|
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++)
|
|
|
|
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()
|
|
|
|
ELSE()
|
|
|
|
MESSAGE(STATUS "Using GCC compiler")
|
|
|
|
MESSAGE(STATUS "Using GCC compiler")
|
|
|
|
|
|
|
|
|
|
|
|