[build]: Add build script for arm64

Change-Id: I4ed1b62ce5baeb21fd8e9fb0d804d48f8d065698
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen 2017-04-06 09:36:36 +08:00
parent bd43fac60e
commit 76e5398633
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,12 @@
cmake_minimum_required( VERSION 2.6.3 )
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
SET(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")
#SET(CMAKE_SYSTEM_PROCESSOR "armv7-a")
SET(CMAKE_SYSTEM_PROCESSOR "armv8")
add_definitions(-fPIC)
add_definitions(-DARMLINUX)

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Run this from within a bash shell
set +e
MPP_PWD=`pwd`
MPP_TOP=${MPP_PWD}/../../..
# toolchain detection
check_cmd(){
"$@" >> /dev/null 2>&1
}
check_system_arm_linux_gcc(){
check_cmd aarch64-linux-gnu-gcc -v
}
check_system_arm_linux_gcc
if [ $? -eq 127 ];then
MPP_TOOLCHAIN=/usr/bin
export PATH=$PATH:${MPP_TOOLCHAIN}
fi
# generate Makefile
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=./arm.linux.cross.cmake \
-DCMAKE_RKPLATFORM_ENABLE=ON \
-G "Unix Makefiles" \
${MPP_TOP}