kopia lustrzana https://github.com/stlink-org/stlink
21 wiersze
788 B
CMake
21 wiersze
788 B
CMake
# set_toolchain.cmake
|
|
# Toolchain file for cross-building on a Debian/Ubuntu Linux system
|
|
|
|
###
|
|
# Set toolchain and configure target environment on the build host system
|
|
###
|
|
|
|
# Set cross compilers to use for C and C++
|
|
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
|
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
|
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
|
|
|
# Set path to directory with headers and libraries of the cross compiler
|
|
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
|
|
|
|
# Modify default behavior of FIND_XXX() commands to search for headers and libraries
|
|
# in the target environment and search for programs in the build host environment
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|