From: Joel Rosdahl Date: Wed, 8 May 2024 18:45:13 +0000 (+0200) Subject: fix: Force run_second_cpp=true when generating profiling information X-Git-Tag: v4.10~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=911b899c6b51c3eb24e8b488361746ec590d2055;p=thirdparty%2Fccache.git fix: Force run_second_cpp=true when generating profiling information 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. --- diff --git a/src/ccache/argprocessing.cpp b/src/ccache/argprocessing.cpp index 6208b9df..346434b3 100644 --- a/src/ccache/argprocessing.cpp +++ b/src/ccache/argprocessing.cpp @@ -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(); }