From 891e17d811248c17d00a22772b6267cb73780ad2 Mon Sep 17 00:00:00 2001 From: rikky Date: Thu, 13 Jan 2011 22:19:42 +0000 Subject: Add:Build/cmake:Added Android build support git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3915 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- Toolchain/arm-eabi.cmake | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Toolchain/arm-eabi.cmake (limited to 'Toolchain') diff --git a/Toolchain/arm-eabi.cmake b/Toolchain/arm-eabi.cmake new file mode 100644 index 000000000..5f3a6b04e --- /dev/null +++ b/Toolchain/arm-eabi.cmake @@ -0,0 +1,31 @@ +set(CMAKE_SYSTEM_NAME GNU) + +set(ANDROID TRUE) +set(ANDROID_API_VERSION 4 CACHE STRING "Andriod API Version") + +find_program(CMAKE_C_COMPILER arm-eabi-gcc arm-eabi-gcc.exe) +find_program(CMAKE_CXX_COMPILER arm-eabi-gcc arm-eabi-g++.exe) +set(PKG_CONFIG_EXECUTABLE "arm-eabi-pkg-config") + +get_filename_component(COMPILER_PATH ${CMAKE_C_COMPILER} PATH) + +set(ANDROID_NDK "${COMPILER_PATH}/../../../../.." CACHE STRING "PATH to Andriod NDK") + +set(NDK_ARCH_DIR "${ANDROID_NDK}/platforms/android-${ANDROID_API_VERSION}/arch-arm") +set(CMAKE_FIND_ROOT_PATH ${NDK_ARCH_DIR}) + +set(CMAKE_REQUIRED_FLAGS "-nostdlib -lc -ldl -lgcc -L${NDK_ARCH_DIR}/usr/lib") +set(CMAKE_REQUIRED_INCLUDES "${NDK_ARCH_DIR}/usr/include") + +set (NAVIT_COMPILE_FLAGS "-I${NDK_ARCH_DIR}/usr/include -g -D_GNU_SOURCE -DANDROID ${CMAKE_REQUIRED_FLAGS}") + +set(CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_REQUIRED_FLAGS} -Wl,--no-undefined -Wl,-rpath,/system/lib") +set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_REQUIRED_FLAGS} -Wl,--no-undefined") +set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_REQUIRED_FLAGS} -Wl,-rpath,/data/data/org.navitproject.navit/lib") + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + + -- cgit v1.2.1