]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Do not handle -o<file> for MSVC (#994)
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>
Mon, 24 Jan 2022 17:07:20 +0000 (19:07 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Jan 2022 17:07:20 +0000 (18:07 +0100)
Co-authored-by: Luboš Luňák <l.lunak@centrum.cz>
src/argprocessing.cpp

index e8d8db8c41295900286c791cffa218afbfe01267..b036d5a6aaebfce4f8f683ee96319764e5e7076e 100644 (file)
@@ -514,8 +514,12 @@ process_arg(const Context& ctx,
   }
 
   // Alternate form of -o with no space. Nvcc does not support this.
+  // Cl does support it as deprecated, but also has -openmp or -link -out
+  // which can confuse this and cause incorrect output_obj (and thus
+  // ccache debug file location), so better ignore it.
   if (util::starts_with(args[i], "-o")
-      && config.compiler_type() != CompilerType::nvcc) {
+      && config.compiler_type() != CompilerType::nvcc
+      && config.compiler_type() != CompilerType::msvc) {
     args_info.output_obj =
       Util::make_relative_path(ctx, string_view(args[i]).substr(2));
     return nullopt;