Created
January 31, 2019 00:58
-
-
Save tisyang/c74e7e9f2986b7dae1c22e8009a2eb5f to your computer and use it in GitHub Desktop.
cmake cross compile toolchain files
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
# this one is important | |
SET(CMAKE_SYSTEM_NAME Linux) | |
SET(SYSTEM_NAME aarch64-linux-gnu) | |
#this one not so much | |
SET(CMAKE_SYSTEM_VERSION 1) | |
# specify the cross compiler | |
SET(CMAKE_C_COMPILER ${SYSTEM_NAME}-gcc) | |
SET(CMAKE_CXX_COMPILER ${SYSTEM_NAME}-g++) | |
# where is the target environment | |
SET(CMAKE_FIND_ROOT_PATH /usr/${SYSTEM_NAME}) | |
# 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) |
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
# this one is important | |
SET(CMAKE_SYSTEM_NAME Linux) | |
SET(SYSTEM_NAME arm-linux-gnueabi) | |
#this one not so much | |
SET(CMAKE_SYSTEM_VERSION 1) | |
# specify the cross compiler | |
SET(CMAKE_C_COMPILER ${SYSTEM_NAME}-gcc) | |
SET(CMAKE_CXX_COMPILER ${SYSTEM_NAME}-g++) | |
# where is the target environment | |
SET(CMAKE_FIND_ROOT_PATH /usr/${SYSTEM_NAME}) | |
# 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) |
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
# this one is important | |
SET(CMAKE_SYSTEM_NAME Linux) | |
SET(SYSTEM_NAME arm-linux-gnueabihf) | |
#this one not so much | |
SET(CMAKE_SYSTEM_VERSION 1) | |
# specify the cross compiler | |
SET(CMAKE_C_COMPILER ${SYSTEM_NAME}-gcc) | |
SET(CMAKE_CXX_COMPILER ${SYSTEM_NAME}-g++) | |
# where is the target environment | |
SET(CMAKE_FIND_ROOT_PATH /usr/${SYSTEM_NAME}) | |
# 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment