【发布时间】:2021-07-22 06:40:58
【问题描述】:
我有一个可工作的 cmake (3.7.2),带有用于基于 gnu 的交叉编译器的工具链文件。 将cmake更新到3.21.0后无法编译简单的测试程序。
输出:
-- The C compiler identification is GNU 4.6.4
-- The CXX compiler identification is GNU 4.6.4
-- Detecting C compiler ABI info
CMake Error: Generator: execution of make failed. Make command was: -f Makefile cmTC_79efc/fast &&
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: <compiler-root-path>/v4.6.6.1/bin/tricore-gcc.exe
CMake Error: Generator: execution of make failed. Make command was: -f Makefile cmTC_30bd9/fast &&
-- Check for working C compiler: <compiler-root-path>/v4.6.6.1/bin/tricore-gcc.exe - broken
CMake Error at <cmake-root-path>/cmake-3.21.0-windows-x86_64/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
'<compiler-root-path>/tricore/v4.6.6.1/bin/tricore-gcc.exe'
is not able to compile a simple test program.
It fails with the following output:
Change Dir: <source-root-path>/build/CMakeFiles/CMakeTmp
Run Build Command(s): -f Makefile cmTC_30bd9/fast && Falscher Parameter
Generator: execution of make failed. Make command was: -f Makefile cmTC_30bd9/fast &&
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (PROJECT)
-- Configuring incomplete, errors occurred!
See also '<source-root-path>/build/CMakeFiles/CMakeOutput.log'.
See also '<source-root-path>/build/CMakeFiles/CMakeError.log'.
make: *** No rule to make target `all'. Stop.
我已经为这个问题搜索了很长时间,但我没有找到解决方案。
我找到了一些几乎相同的解决方案,它们描述了如果 try_compile 不起作用该怎么办。
但是我有一个适用于 V3.7.2 的工作工具链文件(等等),但同样不适用于 V3.21.0。
我也没有发现在更新时必须在工具链文件中更改某些内容。
感谢所有有用的答案。
【问题讨论】:
-
See also '<source-root-path>/build/CMakeFiles/CMakeOutput.log'. See also '<source-root-path>/build/CMakeFiles/CMakeError.log'.请看。用什么命令行来测试编译? -
Message
Generator: execution of make failed.表明 CMake 生成器有问题(在您的情况下为Unix Makefiles)。顺便说一句,Make command was: -f Makefile cmTC_30bd9/fast在-f选项之前显然错过了make。还要确保在更新 CMake 后,对项目执行 clean 配置(构建目录为空)。
标签: cmake cross-compiling updates