Mod aaa-12 增加交叉编译工程配置文件

RCA:
SOL:
修改人:huangxin
检视人:huangxin
This commit is contained in:
huangxin 2019-11-25 15:42:57 +08:00
parent 7bbf06cc6f
commit 1da2dc8c7f
2 changed files with 27 additions and 0 deletions

0
projects/Raspberry.cmake Normal file
View File

27
projects/arm64.cmake Normal file
View File

@ -0,0 +1,27 @@
if(PLAT_ARM64)
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
# this is install root directory
SET(CMAKE_INSTALL_PREFIX /usr)
# specify the cross compiler
SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
SET(CMAKE_STRIP aarch64-linux-gnu-strip)
# specify the cross compile and link flags
set(CMAKE_C_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}")
set(CMAKE_SHARED_LINKER_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}")
SET(CMAKE_LIBRARY_PATH $ENV{SDKTARGETSYSROOT}/usr/lib)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH ${SDKTARGETSYSROOT})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif()