Handle case-insensitive filesystems when ignoring headers on Windows.
if (!ctx.ignore_header_paths.empty()) {
// Canonicalize path for comparison; Clang uses ./header.h.
if (!ctx.ignore_header_paths.empty()) {
// Canonicalize path for comparison; Clang uses ./header.h.
- const std::string& canonical_path_str =
+ auto canonical_path_str =
path_str.str().starts_with("./") ? path_str.str().substr(2) : path_str;
path_str.str().starts_with("./") ? path_str.str().substr(2) : path_str;
+#ifdef _WIN32
+ // Handle case-insensitive paths by converting to lowercase.
+ canonical_path_str = util::to_lowercase(canonical_path_str);
+#endif
for (const auto& ignore_header_path : ctx.ignore_header_paths) {
if (file_path_matches_dir_prefix_or_file(ignore_header_path,
canonical_path_str)) {
for (const auto& ignore_header_path : ctx.ignore_header_paths) {
if (file_path_matches_dir_prefix_or_file(ignore_header_path,
canonical_path_str)) {
util::logging::init(config.debug(), config.log_file());
ignore_header_paths =
util::split_path_list(config.ignore_headers_in_manifest());
util::logging::init(config.debug(), config.log_file());
ignore_header_paths =
util::split_path_list(config.ignore_headers_in_manifest());
+#ifdef _WIN32
+ // Handle case-insensitive paths by converting to lowercase.
+ for (auto& path : ignore_header_paths) {
+ path = util::to_lowercase(path.string());
+ }
+#endif
set_ignore_options(util::split_into_strings(config.ignore_options(), " "));
// Set default umask for all files created by ccache from now on (if
set_ignore_options(util::split_into_strings(config.ignore_options(), " "));
// Set default umask for all files created by ccache from now on (if