From: Joel Rosdahl Date: Mon, 30 Dec 2024 13:23:38 +0000 (+0100) Subject: feat: Add support for clang-cl option /showIncludes:user X-Git-Tag: v4.11~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2c8fb416ca8cb7200828344578232057618ce34;p=thirdparty%2Fccache.git feat: Add support for clang-cl option /showIncludes:user Closes #1534. --- diff --git a/src/ccache/argprocessing.cpp b/src/ccache/argprocessing.cpp index 02f0b036..f7562c0e 100644 --- a/src/ccache/argprocessing.cpp +++ b/src/ccache/argprocessing.cpp @@ -847,7 +847,9 @@ process_option_arg(const Context& ctx, return Statistic::none; } - if (arg == "-showIncludes") { + if (arg == "-showIncludes" + // clang-cl: + || arg == "-showIncludes:user") { args_info.generating_includes = true; state.dep_args.push_back(args[i]); return Statistic::none; diff --git a/src/ccache/argsinfo.hpp b/src/ccache/argsinfo.hpp index d8f673e4..fec843ca 100644 --- a/src/ccache/argsinfo.hpp +++ b/src/ccache/argsinfo.hpp @@ -86,7 +86,8 @@ struct ArgsInfo // Is the compiler being asked to output dependencies? bool generating_dependencies = false; - // Is the compiler being asked to output includes (MSVC /showIncludes)? + // Is the compiler being asked to output includes (MSVC /showIncludes or + // clang-cl /showIncludes:user)? bool generating_includes = false; // The dependency target in the dependency file (the object file unless diff --git a/src/ccache/ccache.cpp b/src/ccache/ccache.cpp index 7530c768..7954bcf8 100644 --- a/src/ccache/ccache.cpp +++ b/src/ccache/ccache.cpp @@ -766,8 +766,9 @@ struct DoExecuteResult util::Bytes stderr_data; }; -// Extract the used includes from /showIncludes output in stdout. Note that we -// cannot distinguish system headers from other includes here. +// Extract the used includes from /showIncludes (or clang-cl's +// /showIncludes:user) output in stdout. Note that we cannot distinguish system +// headers from other includes when /showIncludes is used. static tl::expected result_key_from_includes(Context& ctx, Hash& hash, std::string_view stdout_data) {