4 include(CMakeForceCompiler)
6 set(CMAKE_SYSTEM_NAME Linux)
7 set(CMAKE_SYSTEM_PROCESSOR armv7l)
9 set(CMAKE_C_COMPILER arm-linux-gnueabi-gcc)
10 set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++)
12 set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/6.2.1")
14 # where is the target environment
15 set(NNAS_PROJECT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../..")
16 set(ROOTFS_ARM "${NNAS_PROJECT_SOURCE_DIR}/tools/cross/rootfs/armel")
17 include("${NNAS_PROJECT_SOURCE_DIR}/infra/cmake/modules/OptionTools.cmake")
19 envoption(ROOTFS_DIR ${ROOTFS_ARM})
20 if(NOT EXISTS "${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
21 message(FATAL_ERROR "Please prepare RootFS for tizen ARM softfp")
24 set(CMAKE_SYSROOT ${ROOTFS_DIR})
25 set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR})
27 # search for programs in the build host directories
28 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
30 # for libraries and headers in the target directories
31 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
32 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
34 # Set cache variable to ignore try-run error by find_package(Threads REQUIRED) on cross build
35 set(THREADS_PTHREAD_ARG "2" CACHE STRING "Result from TRY_RUN" FORCE)
38 add_compile_options(-mthumb)
39 add_compile_options(-mfpu=neon-vfpv4)
40 add_compile_options(-mfloat-abi=softfp)
41 add_compile_options(--sysroot=${ROOTFS_DIR})
43 include_directories(SYSTEM ${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
44 include_directories(SYSTEM ${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
45 add_compile_options(-Wno-deprecated-declarations) # compile-time option
46 add_compile_options(-D__extern_always_inline=inline) # compile-time option
48 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -B${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
49 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/lib")
50 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib")
51 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
53 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -B${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
54 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/lib")
55 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib")
56 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")