[build2] Trigger compile of sources when their header dependencies change

Moldmann Max (DC-MA/ENG52-NA) Max.Moldmann at boschrexroth-us.com
Tue Apr 11 17:27:14 UTC 2017


Hi Boris,

file-a.o.d contains:

1
c.compile 1
hash1
hash2
file-a.c

but does not contain "file-a.h". 
But the file-a.d contains the header file:

module-a\_src\file-a.o: module-a\_src\file-a.c \
  module-a\_src\/../_inc/file-a.h

This is on Windows 10.

File        | Touch     | Modify
file-a.h   |      x        |     -        no compile of file-a.c (good as hash has not changed)
file-a.c   |      x        |     -        no compile of file-a.c (good as hash has not changed)
file-a.h   |      -        |     x        no compile of file-a.c (<-- This is the bad case)
file-a.c   |      -        |     x        compile of file-a.c (good)


When I manually add the header file to the end of the o.d file then everything works as expected!

Max

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Tuesday, April 11, 2017 9:26 AM
To: Moldmann Max (DC-MA/ENG52-NA) <Max.Moldmann at boschrexroth-us.com>
Cc: users at build2.org
Subject: Re: [build2] Trigger compile of sources when their header dependencies change

Hi Max,

Moldmann Max (DC-MA/ENG52-NA) <Max.Moldmann at boschrexroth-us.com> writes:

> I noticed that build2 doesn't compile file-a.c when an included header 
> file i.e. file-a.h is changed.

That's strange, this feature has been implemented and working for us for a long time now. You can check for this header in the "aux dependency database" file (file-a.o.d).

If this indeed does not work, I will need a simple project that reproduces this problem as well as the description of the environment (if this is Windows, perhaps it has something to do with timestamp resolution...).

Boris



More information about the users mailing list