From: huangqinjin Date: Wed, 21 Jun 2023 18:04:27 +0000 (+0800) Subject: feat: Don't hash /Fd, /FS or /MP (#1298) X-Git-Tag: v4.9~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=908ca1e22ce4832a329e273e7cf7d29594500bec;p=thirdparty%2Fccache.git 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. --- 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()) {