CMake 忽略工具链文件。如何获得调试/错误输出?

发布于 2024-12-13 01:55:00 字数 393 浏览 7 评论 0原文

我目前正在尝试使用 CMake 进行交叉编译。但是,CMake 似乎忽略了指定的工具链

cmake -DCMAKE_TOOLCHAIN_FILE=my-toolchain.cmake .

cmake . -DCMAKE_TOOLCHAIN_FILE=my-toolchain.cmake

如果我省略 CMAKE_TOOLCHAIN_FILE 选项,则会生成完全相同的 Makefile。此外,如果我故意给出错误的文件名或在工具链文件中插入语法和路径错误,CMake 也不会抱怨。

有没有办法在 CMake 运行期间获得更多错误/调试输出?我能找到的唯一选项是“--debug-output”,这对我来说不是很有帮助。

I'm currently trying to use CMake for cross-compiling. However, CMake seems to ignore the toolchain specified by

cmake -DCMAKE_TOOLCHAIN_FILE=my-toolchain.cmake .

or

cmake . -DCMAKE_TOOLCHAIN_FILE=my-toolchain.cmake

If I omit the CMAKE_TOOLCHAIN_FILE option, the exact same Makefile is generated. Furthermore, if I deliberately give a wrong filename or insert syntax and path errors in the toolchain file, CMake doesn't bother to complain either.

Is there a way to get more error/debug output during a CMake run? The only option I could find is "--debug-output", which isn't very helpful in my case.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狼性发作 2024-12-20 01:55:00

我的错误。 CMake 总是重新生成现有的构建树。通过删除构建目录中的 CMakeCache.txt,CMake 被迫生成新的构建树,并且不再忽略 CMAKE_TOOLCHAIN_FILE 选项。请参阅 CMake 常见问题解答

My mistake. CMake always regenerated an existing build tree. By deleting CMakeCache.txt in the build directory, CMake is forced to generate a new build tree and does not ignore the CMAKE_TOOLCHAIN_FILE option anymore. See the CMake FAQ.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文