Mod aaa-12 更新CMake交叉编译配置
RCA: SOL: 修改人:huangxin 检视人:huangxin
This commit is contained in:
parent
1d76282902
commit
efc55b6560
|
@ -12,30 +12,33 @@ set(CJSON_VERSION_SO 1)
|
|||
set(CJSON_UTILS_VERSION_SO 1)
|
||||
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||
|
||||
if(PLAT_ARM64)
|
||||
# this one is important
|
||||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
#this one not so much
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
# specify the cross compiler
|
||||
SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
|
||||
SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
|
||||
SET(CMAKE_STRIP aarch64-fsl-linux-strip)
|
||||
|
||||
# specify the cross compile and link flags
|
||||
# set(CMAKE_C_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}")
|
||||
# set(CMAKE_SHARED_LINKER_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}")
|
||||
|
||||
# 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()
|
||||
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()
|
||||
|
||||
set(custom_compiler_flags)
|
||||
|
||||
|
|
Loading…
Reference in New Issue