From 74fd67867ef21736ee1546e40ee85a1d4012b850 Mon Sep 17 00:00:00 2001 From: huangqinjin Date: Wed, 11 Sep 2024 01:33:53 +0800 Subject: [PATCH] feat: Add support for MSVC /TC and /TP options (#1499) --- src/ccache/argprocessing.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ccache/argprocessing.cpp b/src/ccache/argprocessing.cpp index c72dcd2f..6255a92d 100644 --- a/src/ccache/argprocessing.cpp +++ b/src/ccache/argprocessing.cpp @@ -608,6 +608,18 @@ process_option_arg(const Context& ctx, state.input_files.emplace_back(arg.substr(3)); return Statistic::none; } + + if (arg == "-TC") { + args_info.actual_language = "c"; + state.common_args.push_back(args[i]); + return Statistic::none; + } + + if (arg == "-TP") { + args_info.actual_language = "c++"; + state.common_args.push_back(args[i]); + return Statistic::none; + } } // when using nvcc with separable compilation, -dc implies -c @@ -1439,7 +1451,7 @@ process_args(Context& ctx) return tl::unexpected(Statistic::unsupported_source_language); } args_info.actual_language = state.explicit_language; - } else { + } else if (args_info.actual_language.empty()) { args_info.actual_language = language_for_file(args_info.input_file, config.compiler_type()); } -- 2.47.2