Boost logo

Boost-Build :

Subject: [Boost-build] Rebuild c++ source when header file is removed (or renamed)
From: Anatoli Sakhnik (sakhnik_at_[hidden])
Date: 2010-01-12 03:40:30


Hi!

There’s one annoying thing, I can’t help it. Sometimes we rename our
header files, and when we try to build the project, the source files,
which included those headers aren’t rebuilt. This leads either to
linker errors or even to incorrect binaries in the worst case.

Is this behaviour indentional? Should the source file with missing
includes be declared as outdated?

Sample:

/////////////////// foo.cc ////////////////////////
#include "Test.hh"
int main() { return 0; }

/////////////////// Jamroot /////////////////////
exe foo : foo.cc ;

//// Session was:
$ bjam
...found 9 targets...
...updating 5 targets...
MkDir1 bin
MkDir1 bin/gcc-4.4.1
MkDir1 bin/gcc-4.4.1/debug
gcc.compile.c++ bin/gcc-4.4.1/debug/foo.o
gcc.link bin/gcc-4.4.1/debug/foo
...updated 5 targets...
$ mv Test.hh Bar.hh
$ bjam
...found 9 targets...
$ sed -i "s/..." Bar.hh # Try to change something there


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk