我想调查一下为什么会出现这个错误:
$ 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)
不幸的是,错误发生后:
CMakeFiles/cmTC_e4aa4.dir被清理,因此我无法自己探索该问题。我应该如何调查这样的错误?
我尝试使用该--debug-trycompile选项。这次 CMake 创建了一个CMakeTmp文件夹,完美无误。但是,我仍然有这个CMakeFiles/cmTC_e4aa4.dir生成错误,甚至使用 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 /获得更多的诊断/调试或跟踪输出?或者如果你能说出我的具体案例中的问题,那也是值得赞赏的.