Skip to content

Commit

Permalink
fix: relative path handling for clang PCH header
Browse files Browse the repository at this point in the history
cmake may generate both -include and -include-pch. Example:

c++ ... -Xclang -include-pch -Xclang /abs/path/cmake_pch.hxx.pch
        -Xclang -include -Xclang /abs/path/cmake_pch.hxx ...

Both paths needs to be converted to relative path if CCACHE_BASEDIR is
set for better cache hit rate in some CI systems.
  • Loading branch information
jiulongw committed Aug 2, 2023
1 parent dc5bb78 commit 0b9f6f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/argprocessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ process_option_arg(const Context& ctx,
if (arg == "-Xclang" && i + 1 < args.size()
&& (args[i + 1] == "-emit-pch" || args[i + 1] == "-emit-pth"
|| args[i + 1] == "-include-pch" || args[i + 1] == "-include-pth"
|| args[i + 1] == "-include"
|| args[i + 1] == "-fno-pch-timestamp")) {
if (compopt_affects_compiler_output(args[i + 1])) {
state.compiler_only_args.push_back(args[i]);
Expand Down

0 comments on commit 0b9f6f1

Please sign in to comment.