Skip to content

Commit

Permalink
Update cross.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Aug 13, 2024
1 parent 444fdc2 commit 3982360
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions cmake/cross.cmake
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)

0 comments on commit 3982360

Please sign in to comment.