return util::starts_with(name, "ccache");
}
-bool
-is_precompiled_header(std::string_view path)
-{
- std::string_view ext = get_extension(path);
- return ext == ".gch" || ext == ".pch" || ext == ".pth"
- || get_extension(dir_name(path)) == ".gch";
-}
-
std::optional<tm>
localtime(std::optional<util::TimePoint> time)
{
;
}
-// Return whether `path` represents a precompiled header (see "Precompiled
-// Headers" in GCC docs).
-bool is_precompiled_header(std::string_view path);
-
// Thread-safe version of `localtime(3)`. If `time` is not specified the current
// time of day is used.
std::optional<tm> localtime(std::optional<util::TimePoint> time = {});
args_info.output_is_precompiled_header =
args_info.actual_language.find("-header") != std::string::npos
- || Util::is_precompiled_header(args_info.output_obj);
+ || is_precompiled_header(args_info.output_obj);
if (args_info.output_is_precompiled_header && output_obj_by_source) {
args_info.orig_output_obj = args_info.orig_input_file + ".gch";
};
}
+bool
+is_precompiled_header(std::string_view path)
+{
+ std::string_view ext = Util::get_extension(path);
+ return ext == ".gch" || ext == ".pch" || ext == ".pth"
+ || Util::get_extension(Util::dir_name(path)) == ".gch";
+}
+
bool
option_should_be_ignored(const std::string& arg,
const std::vector<std::string>& patterns)
#include <optional>
#include <string>
+#include <string_view>
#include <vector>
class Context;
ProcessArgsResult process_args(Context& ctx);
+// Return whether `path` represents a precompiled header (see "Precompiled
+// Headers" in GCC docs).
+bool is_precompiled_header(std::string_view path);
+
bool option_should_be_ignored(const std::string& arg,
const std::vector<std::string>& patterns);
}
}
- const bool is_pch = Util::is_precompiled_header(path);
+ const bool is_pch = is_precompiled_header(path);
const bool too_new = include_file_too_new(ctx, path, st);
if (too_new) {
{
if (!do_remember_include_file(
ctx, path, cpp_hash, system, depend_mode_hash)) {
- if (Util::is_precompiled_header(path)) {
+ if (is_precompiled_header(path)) {
return RememberIncludeFileResult::cannot_use_pch;
} else if (ctx.config.direct_mode()) {
LOG_RAW("Disabling direct mode");