Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@locnnil
Created October 10, 2022 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save locnnil/658e891c8b96ae0fd9a8a1c0f34f3077 to your computer and use it in GitHub Desktop.
Save locnnil/658e891c8b96ae0fd9a8a1c0f34f3077 to your computer and use it in GitHub Desktop.
Cmake Toolchain for ARMv7l architecture
# CMake toolchain file for building ARM software on OI environment
# Processor
SET(CMAKE_SYSTEM_PROCESSOR arm)
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
# (OPTIONAL) specify some CPU flags
SET(cpu_flags "-march=armv7-a -mfloat-abi=softfp -mfpu=neon")
# specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc ${cpu_flags})
SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++ ${cpu_flags})
SET(CMAKE_STRIP /usr/bin/arm-linux-gnueabi-strip)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabi)
# 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