Enable cross compilation to aarch64

Change-Id: Iafc8ac60926f5286990ce63a4ff4f8b6a7c46bef
This commit is contained in:
George Wort
2021-05-17 15:17:38 +01:00
committed by Konstantinos Margaritis
parent 32bd8b131c
commit 2c350e7803
7 changed files with 86 additions and 15 deletions

22
cmake/arm64-cross.cmake Normal file
View File

@@ -0,0 +1,22 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
# specify the cross compiler
set(CMAKE_C_COMPILER "$ENV{CROSS}gcc")
set(CMAKE_CXX_COMPILER "$ENV{CROSS}g++")
# where is the target environment
set(CMAKE_SYSROOT $ENV{CROSS_SYS})
set(Boost_INCLUDE_DIR $ENV{BOOST_PATH})
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(THREADS_PTHREAD_ARG "2" CACHE STRING "Result from TRY_RUN" FORCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -falign-functions=16 -falign-jumps=16 -falign-labels=16 -falign-loops=16" CACHE STRING "" FORCE)
set(GNUCC_ARCH "armv8.2-a+fp16+simd+rcpc+dotprod+crypto")
set(TUNE_FLAG "neoverse-n1")