gpt4 book ai didi

Cmake 交叉编译导致 arm-none-eabi-gcc 测试失败

转载 作者:行者123 更新时间:2023-11-30 17:12:01 24 4
gpt4 key购买 nike

我正在尝试使用cmake交叉编译到arm cortex-m。我已经使用以下 CMakeLists.txt 文件设置了 cmake。

INCLUDE(CMakeForceCompiler)
#cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
SET(CMAKE_SYSTEM_NAME Generic)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
SET(CMAKE_FORCE_C_COMPILER arm-none-eabi-gcc)
SET(CMAKE_FORCE_CXX_COMPILER arm-none-eabi-g++)
#added as test
SET(CMAKE_C_COMPILER arm-none-eabi-gcc)
SET(CMAKE_CXX_COMPILER arm-none-eabi-g++)
# this one is important
SET(CMAKE_SYSTEM_NAME Generic)

#specify the generator to use
SET(CMAKE_GENERATOR "Unix Makefiles")
project(Template C CXX)

但是,当我从构建目录或 gui 运行“cmake ..”时。我收到以下错误。

CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.3/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2014q4/bin/arm-none-eabi-gcc.exe" is not able to compile a simple test program.

为什么 cmake 尝试测试编译器?我该如何让它停止?我尝试使用 NONE 作为语言,但它不知道链接语言。有什么想法吗?

最佳答案

CMAKE_FORCE_C_COMPILERdocumentation :

It sets CMAKE_C_COMPILER to the given compiler and the cmake internal variable CMAKE_C_COMPILER_ID to the given compiler-id. It also bypasses the check for working compiler and basic compiler information tests.

关于Cmake 交叉编译导致 arm-none-eabi-gcc 测试失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31845907/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com