hash.hash(dir_to_hash);
}
+ // The object file produced by MSVC includes the full path to the object file
+ // even without debug flags. Hashing the directory should be enough since the
+ // filename is included in the hash anyway.
+ if (ctx.config.is_compiler_group_msvc() && ctx.config.hash_dir()) {
+ const std::string output_obj_dir =
+ util::is_absolute_path(args_info.output_obj)
+ ? std::string(Util::dir_name(args_info.output_obj))
+ : ctx.actual_cwd;
+ LOG("Hashing object file directory {}", output_obj_dir);
+ hash.hash_delimiter("source path");
+ hash.hash(output_obj_dir);
+ }
+
if ((!should_rewrite_dependency_target(ctx.args_info)
&& ctx.args_info.generating_dependencies)
|| ctx.args_info.seen_split_dwarf || ctx.args_info.profile_arcs) {