CMake 忽略工具链文件。如何获得调试/错误输出?
我目前正在尝试使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的错误。 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.