-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
# the name of the target operating system | ||
# 示例: | ||
# ccmake .. -DCOMPILER=mipsel-linux -DCMAKE_SYSTEM_PROCESSOR=mips32 -DCMAKE_TOOLCHAIN_FILE=../cmake/cross.cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -G Ninja -DCMAKE_BUILD_TYPE=Release | ||
# ccmake .. -DCOMPILER=aarch64-linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_TOOLCHAIN_FILE=../cmake/cross.cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -G Ninja -DCMAKE_BUILD_TYPE=Release | ||
|
||
# 设置目标操作系统 | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
|
||
#set(CMAKE_SYSTEM_PROCESSOR mips32) | ||
#set(CMAKE_SYSTEM_PROCESSOR arm64) | ||
# 也可以在这里设置处理器架构 | ||
# 一般有 armv7-a|aarch64|mips|arm64|riscv64|riscv32 等值 | ||
# set(CMAKE_SYSTEM_PROCESSOR aarch64) | ||
|
||
# see https://toolchains.bootlin.com/ | ||
# which compilers to use for C and C++ | ||
# 设置编译器名称,必须在 PATH 中,一般名称比如: | ||
# mipsel-linux-g++ | ||
# mipsel-openwrt-linux-musl-gcc | ||
# ... | ||
|
||
set(CMAKE_C_COMPILER ${COMPILER}-gcc) | ||
set(CMAKE_CXX_COMPILER ${COMPILER}-g++) | ||
|
||
# where is the target environment located | ||
#set(CMAKE_FIND_ROOT_PATH /usr/bin) | ||
|
||
# adjust the default behavior of the FIND_XXX() commands: | ||
# search programs in the host environment | ||
#set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
|
||
# search headers and libraries in the target environment | ||
#set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
#set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
|