diff --git a/implementations/Crafter.Build-Implementation.cpp b/implementations/Crafter.Build-Implementation.cpp index ca39bac..6f0b355 100644 --- a/implementations/Crafter.Build-Implementation.cpp +++ b/implementations/Crafter.Build-Implementation.cpp @@ -51,8 +51,13 @@ namespace Crafter { return; } - // -MD leaves _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 _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)) {