[cmake-developers] [CMake 0014167]: ninja: source files including generated headers are not rebuilt after header change

Mantis Bug Tracker mantis at public.kitware.com
Thu May 23 16:59:02 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://cmake.org/Bug/view.php?id=14167 
====================================================================== 
Reported By:                Reid Kleckner
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14167
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-05-23 16:59 EDT
Last Modified:              2013-05-23 16:59 EDT
====================================================================== 
Summary:                    ninja: source files including generated headers are
not rebuilt after header change
Description: 
Originally reported to ninja-build:
https://groups.google.com/forum/?fromgroups#!topic/ninja-build/WLFbu68lN5U

The problem is that cmcldeps produces depfiles with paths that aren't identical
(modulo case) to the ones used to identify artifacts in the build.ninja file.

Two things need to change to make implicit generated header deps work:
1. path separators need to match the build.ninja file
2. paths in the build dir should be relative to the build dir

I'll attach a patch that fixes the problem for me locally.

Steps to Reproduce: 
Unpack the attached cmake project and do the following from the project src dir:

1. cmake -GNinja .
2. ninja
3. modify the string in dir/header.txt
4. ninja  # Observe that only one action is taken
5. ./foo.exe  # Observe that the old string is printed
6. ninja  # Observe that the build finishes
7. ./foo.exe  # Now the new string is printed
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-05-23 16:59 Reid Kleckner  New Issue                                    
2013-05-23 16:59 Reid Kleckner  File Added: gen_header.zip                    
======================================================================




More information about the cmake-developers mailing list