]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Don't hash /Fd, /FS or /MP (#1298)
authorhuangqinjin <huangqinjin@gmail.com>
Wed, 21 Jun 2023 18:04:27 +0000 (02:04 +0800)
committerGitHub <noreply@github.com>
Wed, 21 Jun 2023 18:04:27 +0000 (20:04 +0200)
/Fd is to specify the file name of output PDB. But currently ccache only
supports /Z7 which doesn't generate PDB at compile time.

/FS forces writes to PDB to be serialized through MSPDBSRV.EXE.
It shouldn't affect generated files and it has no effect for /Z7.

/MP enables /FS. It creates multiple compiler instances and simultaneously
compile multiple source files which is not supported by ccache.

src/argprocessing.cpp

index 6e38b4b873aa48b8f83ebb957a7e3c18ac3ed155..3303ca14d401a15648ab864a9ae7e51e074a0e8e 100644 (file)
@@ -623,6 +623,17 @@ process_option_arg(const Context& ctx,
     return Statistic::none;
   }
 
+  if (config.is_compiler_group_msvc() && util::starts_with(arg, "-Fd")) {
+    state.compiler_only_args_no_hash.push_back(args[i]);
+    return Statistic::none;
+  }
+
+  if (config.is_compiler_group_msvc()
+      && (util::starts_with(arg, "-MP") || arg == "-FS")) {
+    state.compiler_only_args_no_hash.push_back(args[i]);
+    return Statistic::none;
+  }
+
   // These options require special handling, because they behave differently
   // with gcc -E, when the output file is not specified.
   if ((arg == "-MD" || arg == "-MMD") && !config.is_compiler_group_msvc()) {