fix: recompile the units whose std module was rebuilt in place
A .cpp unit's depfile listed its source and headers, never the BMIs it imports: clang's driver adds -module-file-deps to --precompile only. A std module rebuilt in its directory, which happens whenever its source changes under one compiler and one set of flags (a libc++ update, or mingw-w64's under the same prefix), left every object that imports it as it was, and the next build only relinked them. Implementation units are now compiled with -fmodule-file-deps, so the std PCM and the project's own PCMs are prerequisites of their objects like headers. Depfiles written before this lack the edge, so a std module that moves directories still needs VariantId to move with it (StdPcmKey). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5d25495621
commit
27697d06aa
1 changed files with 7 additions and 2 deletions
|
|
@ -51,8 +51,13 @@ namespace Crafter {
|
|||
return;
|
||||
}
|
||||
|
||||
// -MD leaves <name>_impl.o.d beside the object for Check to read.
|
||||
std::string result = RunBuildCommand(std::format("{0} {1}.cpp -c -MD -MF {2}_impl.o.d -o {2}_impl.o", clang, path.string(), (buildDir/path.filename()).string()));
|
||||
// -MD leaves <name>_impl.o.d beside the object for Check to read, and
|
||||
// -fmodule-file-deps puts the BMIs the unit imported in it with the
|
||||
// headers. The driver adds that for --precompile only, so a std
|
||||
// module rebuilt in place, for a mingw-w64 or libc++ update under
|
||||
// the same compiler, left the objects importing it as they were, and
|
||||
// the next build only relinked them.
|
||||
std::string result = RunBuildCommand(std::format("{0} {1}.cpp -c -MD -MF {2}_impl.o.d -fmodule-file-deps -o {2}_impl.o", clang, path.string(), (buildDir/path.filename()).string()));
|
||||
|
||||
bool expected = false;
|
||||
if(!result.empty() && buildCancelled.compare_exchange_strong(expected, true)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue