rebuilding triggering a build of all files

19 views
Skip to first unread message

Greg Troxel

unread,
May 12, 2026, 9:02:54 AM (4 days ago) May 12
to rtl433
On a RPI3 with Raspberry Pi OS 32-bit, I'm building rtl-433 from git
master plus my pending fix to battery_ok for fineoffset moisture
sensors.

I did "mkdir build && cd build && cmake .." long ago.

Recently I updated and got 6 months of changes and just ran gmake in the
build dir. Everything was rebuilt but that didn't surprise me.

Then, I just changed src/devices/fineoffset.c and re-ran gmake. It ran
cmake again (not sure why, but not really a problem) and then seems to
have rebuilt everything, including the dreaded mongoose.c.

My expectation is that make works and only rebuilds things that changed.

I wonder

- are others seeing this
- is cmake writing .h files that then are changed (even if they are
the same)
- should cmake not be running?
- how does this work in general? Does cmake have a way to generate,
compare, and move in place if different?
- am I somehow confused?

Christian Z.

unread,
May 12, 2026, 11:29:32 AM (4 days ago) May 12
to rtl_433
Incremental builds work, but touching Git will do a full rebuild.

$ cmake -GNinja -B build
...
$ cmake --build build
...
[349/349] Linking C executable src/rtl_433
$ cmake --build build
ninja: no work to do.
$ date >>README.md
$ git add README.md
$ git commit -m 'testing'
$ cmake --build build
...
[349/350] Linking C executable src/rtl_433


The dependency that causes this are the ADD_DEFINITIONS() for Git info in the main CMakeLists.txt (around line 39).
Remove or replace them to always get Incremental builds. Maybe writting that info as #define's to a header file could fix the dependencies?

Greg Troxel

unread,
May 12, 2026, 12:04:06 PM (4 days ago) May 12
to Christian Z., rtl_433
"Christian Z." <chri...@zuckschwerdt.org> writes:

> Incremental builds work, but touching Git will do a full rebuild.
>
> $ cmake -GNinja -B build
> ...
> $ cmake --build build
> ...
> [349/349] Linking C executable src/rtl_433
> $ cmake --build build
> ninja: no work to do.
> $ date >>README.md
> $ git add README.md
> $ git commit -m 'testing'
> $ cmake --build build
> ...
> [349/350] Linking C executable src/rtl_433
>
> The dependency that causes this are the ADD_DEFINITIONS() for Git info in
> the main CMakeLists.txt (around line 39).

That explains it

> Remove or replace them to always get Incremental builds. Maybe writting
> that info as #define's to a header file could fix the dependencies?

Generally, it seems best to put the version in version.h and only build
a version.c that references it, to avoid this sort of mass-rebuild
dependency.

Christian Z.

unread,
May 12, 2026, 12:37:51 PM (4 days ago) May 12
to rtl_433
Reply all
Reply to author
Forward
0 new messages