[cmake-developers] ninja failing CompileCommandOutput

Bill Hoffman bill.hoffman at kitware.com
Mon Jun 4 10:25:34 EDT 2012


On 6/1/2012 1:55 PM, Brad King wrote:
> The generator is supposed to produce a file that lists all the
> compiler invocation command lines in a JSON format.  The test
> runs a build with the option and then runs a program that reads
> the generated file and re-plays the commands.  The test and its
> C++ program should not need modification because it works for the
> Makefile generator.  The Ninja generator will need to generate
> the properly encoded commands like the Makefile generator does.

Seems like the json file is reasonable:

{
   "directory": "C:/Users/hoffman/Work/My 
Builds/CMake-ninja-build/Tests/CompileCommandOutput",
   "command": "C:\\PROGRA~2\\MICROS~1.0\\VC\\bin\\cl.exe   /nologo 
/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /D_DEBUG /MDd /Zi /Ob0 /Od 
/RTC1 -I\"c:\\Users\\hoffman\\Work\\My 
Builds\\NinjaCMake\\Tests\\CompileCommandOutput\\..\\..\\Source\" 
/TP 
/FoCMakeFiles/CompileCommandOutput.dir/compile_command_output.cxx.obj 
/FdTARGET_PDB -c \"c:\\Users\\hoffman\\Work\\My 
Builds\\NinjaCMake\\Tests\\CompileCommandOutput\\compile_command_output.cxx\"",
   "file": "c:\\Users\\hoffman\\Work\\My 
Builds\\NinjaCMake\\Tests\\CompileCommandOutput\\compile_command_output.cxx"
},

Might be a parsing issue.  This test also fails with the nmake generator 
which produces a very similar json file:
   "command": "C:\\PROGRA~2\\MICROS~1.0\\VC\\bin\\cl.exe  @<<
  /nologo  /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /D_DEBUG /MDd /Zi 
/Ob0 /Od /RTC1 
-IC:\\Users\\hoffman\\Work\\MYBUIL~1\\cmake\\Tests\\COMPIL~1\\..\\..\\Source 
     /TP 
/FoCMakeFiles\\CompileCommandOutput.dir\\compile_command_output.cxx.obj 
/Fd\"C:\\Users\\hoffman\\Work\\My 
Builds\\cmake-nmake\\Tests\\CompileCommandOutput\\CompileCommandOutput.pdb\" 
-c \"C:\\Users\\hoffman\\Work\\My 
Builds\\cmake\\Tests\\CompileCommandOutput\\compile_command_output.cxx\"
<<",
   "file": "C:/Users/hoffman/Work/My 
Builds/cmake/Tests/CompileCommandOutput/compile_command_output.cxx"


That does not show up on the dashboard because of this:

   IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefiles" OR 
"${CMAKE_TEST_GENERATOR}" MATCHES Ninja)
     SET(TEST_CompileCommandOutput 1)
   ENDIF()

See, like the test driver should be able to read a file with \\ in it, 
and the generator output is fine.

-Bill




-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573



More information about the cmake-developers mailing list