fix: give the mingw target a sysroot that holds mingw-w64 alone #44
1 changed files with 7 additions and 2 deletions
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>
commit
27697d06aa
|
|
@ -51,8 +51,13 @@ namespace Crafter {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -MD leaves <name>_impl.o.d beside the object for Check to read.
|
// -MD leaves <name>_impl.o.d beside the object for Check to read, and
|
||||||
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()));
|
// -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;
|
bool expected = false;
|
||||||
if(!result.empty() && buildCancelled.compare_exchange_strong(expected, true)) {
|
if(!result.empty() && buildCancelled.compare_exchange_strong(expected, true)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue