2017-04-10 11:41:01 +00:00
|
|
|
set(CROSS_ROOTFS $ENV{ROOTFS_DIR})
|
|
|
|
|
|
|
|
set(CMAKE_SYSTEM_NAME Linux)
|
|
|
|
set(CMAKE_SYSTEM_VERSION 1)
|
|
|
|
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
|
|
|
|
|
|
|
set(TOOLCHAIN "aarch64-linux-gnu")
|
|
|
|
|
|
|
|
add_compile_options(-target ${TOOLCHAIN})
|
|
|
|
add_compile_options(--sysroot=${CROSS_ROOTFS})
|
|
|
|
|
2017-06-07 13:16:24 +00:00
|
|
|
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/include/)
|
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
|
|
|
|
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
|
|
|
|
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN}")
|
|
|
|
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
|
|
|
|
|
|
|
|
set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
2017-06-07 13:16:24 +00:00
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|