}
state.common_args.push_back(args[i]);
auto relpath = core::make_relative_path(ctx, args[i + 1]);
- state.common_args.push_back(util::pstr(relpath));
+ state.common_args.push_back(relpath);
i++;
return Statistic::none;
}
if (next == 2) {
dest_args.push_back(args[i + 1]);
}
- dest_args.push_back(util::pstr(relpath));
+ dest_args.push_back(relpath);
i += next;
return Statistic::none;
}
if (!args_info.dependency_target) {
- std::string dep_target = util::pstr(args_info.orig_output_obj);
+ fs::path dep_target = args_info.orig_output_obj;
// GCC and Clang behave differently when "-Wp,-M[M]D,wp.d" is used with
// "-o" but with neither "-MMD" nor "-MT"/"-MQ": GCC uses a dependency
} else if (config.compiler_type() == CompilerType::gcc) {
// GCC strangely uses the base name of the source file but with a .o
// extension.
- dep_target = util::pstr(util::with_extension(
- args_info.orig_input_file.filename(),
- get_default_object_file_extension(ctx.config)));
+ dep_target =
+ util::with_extension(args_info.orig_input_file.filename(),
+ get_default_object_file_extension(ctx.config));
} else {
// How other compilers behave is currently unknown, so bail out.
LOG_RAW(
}
}
- args_info.dependency_target = Depfile::escape_filename(dep_target);
+ args_info.dependency_target =
+ Depfile::escape_filename(util::pstr(dep_target).str());
}
}
// 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 =
- args_info.output_obj.is_absolute()
- ? args_info.output_obj.parent_path().string()
- : util::pstr(ctx.actual_cwd);
+ const fs::path& output_obj_dir = args_info.output_obj.is_absolute()
+ ? args_info.output_obj.parent_path()
+ : ctx.actual_cwd;
LOG("Hashing object file directory {}", output_obj_dir);
hash.hash_delimiter("source path");
hash.hash(output_obj_dir);