SOEM vscode 交叉编译

Github SOEM

# 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)




你可能感兴趣的:(电机,嵌入式,vscode,ide,编辑器)