]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Force run_second_cpp=true when generating profiling information
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 8 May 2024 18:45:13 +0000 (20:45 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 8 May 2024 19:03:01 +0000 (21:03 +0200)
If run_second_cpp=false the coverage report will refer to the temporary
preprocessed file instead of the source file. Fix this by forcing
run_second_cpp=true if profiling information is being generated.

Fixes #1441.

src/ccache/argprocessing.cpp

index 6208b9df5276bd9107bd947f2187958b0a1deefe..346434b39a32825cd80a59e408149e453853aaa9 100644 (file)
@@ -1382,6 +1382,12 @@ process_args(Context& ctx)
     }
   }
 
+  if (args_info.profile_generate && !config.run_second_cpp()) {
+    LOG_RAW(
+      "Generating profiling information; not compiling preprocessed code");
+    config.set_run_second_cpp(true);
+  }
+
   if (args_info.profile_path.empty()) {
     args_info.profile_path = pstr(ctx.apparent_cwd).str();
   }