Bug #27

Precompiled header on GCC based platform with wrong dependencies

Added by Steven Craft about 7 years ago. Updated almost 7 years ago.

Status:ResolvedStart date:08/03/2010
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Building
Target version:-

Description

I have an example of:

  • myfile.cpp
  • stdafx.h
  • system.h

myfile.cpp uses stdafx.h as a precompiled header, and stdafx.h #includes system.h. If after the first full rebuild, I modify/touch system.h, when I hit build again, it rebuilds myfile.cpp, but it doesn't NOT recreate the precompiled header (stdafx.h -> stdafx.h.gch). To get the precompiled header to build I have to do a clean followed by another build.

History

#1 Updated by Steven Craft about 7 years ago

I have put together a test case for this:

http://github.com/Scraft/jamplus/commit/bdb07ef5c14d6c136dd5528fb57be40ab83c8a18

It is targeted at PS3, but I believe it should happen for any GCC based platform (it happens for me both on PS3 and Wii).

STeve

#2 Updated by Steven Craft about 7 years ago

Also, I should point out, precompiled headers do correctly get regenerated on Win32-VC builds, and I wonder if the root problem behind this is that Win32-VC creates the PCH by building stdafx.cpp, so when I touch something stdafx.cpp is dependent on (system.h), it triggers stdafx.cpp to rebuild, which regenerates the PCH, which keeps everything in sync. On GCC based platforms, stdafx.cpp is not what causes the precompiled header to be created, but it builds stdafx.cpp anyway:

1>------ Build started: Project: precompiled_header_deps, Configuration: Ps3-Sony-Gcc Debug Win32 ------
1>Performing Makefile project actions
1>* found 24 target(s)...
1>
* updating 7 target(s)...
1>@ C.C++

stdafx.o 
1>@ C.Link patience...

I'm not sure what the fix is for this, but I think this somewhat narrows it down.

Steve

#3 Updated by Joshua Jensen almost 7 years ago

  • Status changed from New to Resolved

Is this fixed now? I think it is. Let's close the bug if it isn't reproducible with latest.

Also available in: Atom PDF