From: Joel Rosdahl Date: Sat, 3 Feb 2024 16:13:12 +0000 (+0100) Subject: feat: Add support for MSVC /Tc and /Tp options X-Git-Tag: v4.10~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b8aaf562febeed81a1d27a6e498d63b8b4f6877;p=thirdparty%2Fccache.git feat: Add support for MSVC /Tc and /Tp options Closes #1387. --- diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index a61317e5f..f1a11ab3a 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -555,10 +555,19 @@ process_option_arg(const Context& ctx, return Statistic::none; } - // MSVC -Fo with no space. - if (util::starts_with(arg, "-Fo") && config.is_compiler_group_msvc()) { - args_info.output_obj = arg.substr(3); - return Statistic::none; + if (config.is_compiler_group_msvc()) { + // MSVC /Fo with no space. + if (util::starts_with(arg, "-Fo")) { + args_info.output_obj = arg.substr(3); + return Statistic::none; + } + + // MSVC /Tc and /Tp options for specifying input file. + if (arg.length() > 3 && util::starts_with(arg, "-T") + && (arg[2] == 'c' || arg[2] == 'p')) { + size_t file_index = arg[3] == ' ' ? 4 : 3; + state.input_files.emplace_back(arg.substr(file_index)); + } } // when using nvcc with separable compilation, -dc implies -c