MantisBT - CMake
View Issue Details
0013559CMakeCMakepublic2012-09-25 08:532013-07-01 09:37
Yuchen Deng 
Peter Kuemmel 
normalminoralways
closedfixed 
Windows/LinuxWin7 Ubuntu 12.04
CMake 2.8.9 
CMake 2.8.10CMake 2.8.10 
0013559: Ninja: Wrong dependency with PCH support
Here is the ML discussion:
http://www.cmake.org/pipermail/cmake/2012-September/052144.html [^]

3. It seems does not support PCH fully. e.g. change the PCH source (MSVC) or header (GCC), if using CMake Makefiles Generator, and will compilation every source files if it depends on PCH binary file. But using nanja, seems does not re-builds source files, just only updated the PCH binary.

---

function(use_msvc_precompiled_header target sources)
    foreach(src ${sources})
        set_source_files_properties(${src} PROPERTIES
            COMPILE_FLAGS "/Yu\"${pchBinaryFile}\" /FI\"${pchBinaryFile}\" /Fp\"${pchBinaryFile}\""
            OBJECT_DEPENDS ${pchBinaryFile}
        )
    endforeach()
endfunction()

See: set_source_files_properties, the OBJECT_DEPENDS setting does not work with Ninja Generator, but works well with NMake Makefiles and Unix Makefiles generator.
No tags attached.
related to 0013592closed Peter Kuemmel Ninja: Inefficient Ninja DAG with add_custom_command 
related to 0013874closed Peter Kuemmel Ninja: generated files like moc, huge deps list 
Issue History
2012-09-25 08:53Yuchen DengNew Issue
2012-09-25 09:29Peter KuemmelNote Added: 0031101
2012-09-25 09:29Peter KuemmelAssigned To => Peter Kuemmel
2012-09-25 09:29Peter KuemmelStatusnew => assigned
2012-10-03 08:47Peter KuemmelNote Added: 0031161
2012-10-03 08:47Peter KuemmelStatusassigned => resolved
2012-10-03 08:47Peter KuemmelFixed in Version => CMake 2.8.10
2012-10-03 08:47Peter KuemmelResolutionopen => fixed
2012-10-24 17:29David ColeTarget Version => CMake 2.8.10
2012-11-20 16:26Peter KuemmelRelationship addedrelated to 0013592
2013-02-16 06:41Peter KuemmelRelationship addedrelated to 0013874
2013-07-01 09:37Robert MaynardNote Added: 0033424
2013-07-01 09:37Robert MaynardStatusresolved => closed

Notes
(0031101)
Peter Kuemmel   
2012-09-25 09:29   
Looks like wrong dependency is used,
http://martine.github.com/ninja/manual.html#ref_dependencies [^]

void
cmNinjaTargetGenerator
::WriteObjectBuildStatement(cmSourceFile* source)
{
  ...
  cmNinjaDeps explicitDeps;

  ...
  // Ensure that the target dependencies are built before any source file in
  // the target, using order-only dependencies.
  cmNinjaDeps orderOnlyDeps;
  this->GetLocalGenerator()->AppendTargetDepends(this->Target, orderOnlyDeps);

  if(const char* objectDeps = source->GetProperty("OBJECT_DEPENDS")) {
    std::vector<std::string> depList;
    cmSystemTools::ExpandListArgument(objectDeps, depList);
    std::transform(depList.begin(), depList.end(),
                   std::back_inserter(orderOnlyDeps), MapToNinjaPath());
  }
(0031161)
Peter Kuemmel   
2012-10-03 08:47   
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f0e08d503c83f47f13efc21437e30b96c114639 [^]
(0033424)
Robert Maynard   
2013-07-01 09:37   
Closing resolved issues that have not been updated in more than 4 months.