2020#include < primitives/hash.h>
2121#include < primitives/templates.h>
2222#include < primitives/debug.h>
23+ #include < primitives/sw/settings.h>
2324
2425#include < sstream>
2526
@@ -28,6 +29,8 @@ DECLARE_STATIC_LOGGER(logger, "file");
2829
2930#define CPPAN_FILES_EXPLAIN_FILE (getUserDirectories().storage_dir_tmp / " explain.txt" )
3031
32+ static cl::opt<bool > explain_outdated (" explain-outdated" , cl::desc(" Explain outdated files" ));
33+
3134namespace sw
3235{
3336
@@ -41,7 +44,7 @@ primitives::filesystem::FileMonitor &get_file_monitor()
4144
4245void explainMessage (const String &subject, bool outdated, const String &reason, const String &name)
4346{
44- if (!Settings::get_local_settings (). explain_outdated && 0 )
47+ if (!explain_outdated)
4548 return ;
4649 static Executor e (1 );
4750 static std::ofstream o (CPPAN_FILES_EXPLAIN_FILE.string ());
@@ -454,15 +457,16 @@ bool FileRecord::isChanged()
454457
455458void FileRecord::setGenerator (const std::shared_ptr<builder::Command> &g)
456459{
457- // DEBUG_BREAK_IF_PATH_HAS(file, "settings.yy.cpp ");
460+ DEBUG_BREAK_IF_PATH_HAS (file, " /primitives.filesystem-master.dll " );
458461
459462 if (!g)
460463 return ;
461464
462465 auto gold = generator.lock ();
463- if (gold && (gold != g && !gold->isExecuted () && !gold->maybe_unused
464- /* && gold->getHash() != g->getHash()*/
465- ))
466+ if (gold && (gold != g &&
467+ !gold->isExecuted () &&
468+ !gold->maybe_unused &&
469+ gold->getHash () != g->getHash ()))
466470 throw std::runtime_error (" Setting generator twice on file: " + file.u8string ());
467471 generator = g;
468472 generated_ = true ;
0 commit comments