[cmake-developers] [CMake 0013559]: Ninja: Wrong dependency with PCH support

Mantis Bug Tracker mantis at public.kitware.com
Tue Sep 25 08:53:31 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13559 
====================================================================== 
Reported By:                Yuchen Deng
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13559
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-09-25 08:53 EDT
Last Modified:              2012-09-25 08:53 EDT
====================================================================== 
Summary:                    Ninja: Wrong dependency with PCH support
Description: 
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.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-09-25 08:53 Yuchen Deng    New Issue                                    
======================================================================




More information about the cmake-developers mailing list