]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Add support for clang-cl option /showIncludes:user
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 30 Dec 2024 13:23:38 +0000 (14:23 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 30 Dec 2024 14:26:19 +0000 (15:26 +0100)
Closes #1534.

src/ccache/argprocessing.cpp
src/ccache/argsinfo.hpp
src/ccache/ccache.cpp

index 02f0b036a8886d3fe3f0a69eb10f090fbceb3b88..f7562c0e6f3024018849667a54231c4920c32f20 100644 (file)
@@ -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;
index d8f673e463a9eaf64b3c5316cf1f910024535e7a..fec843cabf48ca4338da304a59c322544422f9b6 100644 (file)
@@ -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
index 7530c76826abfaed9c4178f8bd463ab7ac1f8957..7954bcf876d5aade0f904f0871ff8ca2ed9a16ea 100644 (file)
@@ -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<Hash::Digest, Failure>
 result_key_from_includes(Context& ctx, Hash& hash, std::string_view stdout_data)
 {