相关疑难解决方法(0)

如何调试CMakeLists.txt文件?

CMakeLists.txt除了消息语句之外,是否有可能调试文件(至少列出变量)?

cmake

66
推荐指数
5
解决办法
4万
查看次数

如何获得 CMake 的详细输出?

我想调查一下为什么会出现这个错误:

$ cmake ..
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /cygdrive/c/Users/Ycr/Home/bin/arm-none-eabi-gcc
-- Check for working C compiler: /cygdrive/c/Users/Ycr/Home/bin/arm-none-eabi-gcc -- broken
CMake Error at /usr/share/cmake-3.6.2/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/cygdrive/c/Users/Ycr/Home/bin/arm-none-eabi-gcc" is not
  able to compile a simple test program.
Run Code Online (Sandbox Code Playgroud)

不幸的是,错误发生后:

  • 我不知道 CMake 做了什么。我没有它执行的命令的详细日志。
  • 错误发生后已CMakeFiles/cmTC_e4aa4.dir被清理,因此我无法自己探索该问题。

我应该如何调查这样的错误?

我尝试使用该--debug-trycompile选项。这次 CMake 创建了一个CMakeTmp文件夹,完美无误。但是,我仍然有这个CMakeFiles/cmTC_e4aa4.dir生成错误,甚至使用 CMake 选项取消文件夹链接。

cmake

6
推荐指数
1
解决办法
1万
查看次数

详细cmake:如何获得更多诊断?

我从cmake得到一些奇怪的错误:

loading initial cache file ../../Tweaks/compiler-rt/arm.txt
-- Performing Test COMPILER_RT_HAS_FPIE_FLAG
CMake Error at CMakeLists.txt:2 (set):
  Syntax error in cmake code at

    D:/Work/AcSo/Views/llvmSecond/build-arm/compiler-rt/CMakeFiles/CMakeTmp/CMakeLists.txt:2

  when parsing string

    D:/Work/AcSo/Views/llvmSecond/llvm/projects/compiler-rt/cmake;D:/Work/AcSo/Views/llvmSecond/llvm/projects/compiler-rt/cmake/Modules;D:/Work/AcSo/Views/llvmSecond/llvm/cmake;D:\Work\AcSo\Views\llvmSecond\build-host\Release\lib\cmake\llvm

  Invalid character escape '\W'.


CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Configuring incomplete, errors occurred!
See also "D:/Work/AcSo/Views/llvmSecond/build-arm/compiler-rt/CMakeFiles/CMakeOutput.log".
Run Code Online (Sandbox Code Playgroud)

我能理解的是它以某种方式得到了一个Windows路径,然后抱怨\W字符序列.实际上我已经尽我所能给cmake Linux路径.所以我不知道Windows路径的来源.这个错误似乎没什么关系CMakeOutput.log

我想从cmake获得更多的诊断,即它是什么以及它为什么,但是搜索"cmake verbose"而不是给出关于制作make详细信息的结果,而不是cmake本身.

有没有办法强制cmake verbose /获得更多的诊断/调试或跟踪输出?或者如果你能说出我的具体案例中的问题,那也是值得赞赏的.

infrastructure build configure cmake verbose

4
推荐指数
1
解决办法
9476
查看次数

标签 统计

cmake ×3

build ×1

configure ×1

infrastructure ×1

verbose ×1