SOEM vscode 交叉编译
【代码】SOEM vscode 交叉编译。
·
# arm-linux-gnueabihf.cmake
# CMake toolchain file for ARM Linux cross-compilation
# Set the target system
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
# Specify the cross compiler
set(CMAKE_C_COMPILER "d:/program/arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-gcc.exe")
set(CMAKE_CXX_COMPILER "d:/program/arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++.exe")
# Where is the target environment located
set(CMAKE_FIND_ROOT_PATH "d:/program/arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf")
# 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)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# Don't use Windows-specific settings
set(WIN32 FALSE)
set(UNIX TRUE)
# Explicitly set the system name to Linux to ensure proper platform detection
set(CMAKE_SYSTEM_NAME Linux)
更多推荐
所有评论(0)