From 908ca1e22ce4832a329e273e7cf7d29594500bec Mon Sep 17 00:00:00 2001 From: huangqinjin Date: Thu, 22 Jun 2023 02:04:27 +0800 Subject: [PATCH] feat: Don't hash /Fd, /FS or /MP (#1298) /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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index 6e38b4b87..3303ca14d 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -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()) { -- 2.47.2