File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 66JSON_OUT=" $( pwd) /compile_commands.json"
77BAZEL_ROOT=" $( bazel info execution_root 2> /dev/null) "
88WORKSPACE=" $( bazel info workspace 2> /dev/null) "
9+ OUTPUT_BASE=" $( bazel info output_base 2> /dev/null) "
910echo " Generating compile_commands.json..."
1011find " $BAZEL_ROOT " -name ' *.compile_command.json' -print0 | while read -r -d ' ' fname; do
1112 # dirty hack: what if we have 'external' dir in workspace?
12- sed -e " s|@BAZEL_ROOT@| $BAZEL_ROOT |g " < " $fname " | perl -pe " s#-isystem (?!bazel-out|external)#-isystem $WORKSPACE /#g " >> $JSON_OUT
13+ perl -pe ' if (/"file":"external/){$p=" ' $OUTPUT_BASE ' ";}else{$p=" ' $WORKSPACE ' ";}; s/\@BAZEL_ROOT\@/$p/; s#-i(system|quote) external/#-i$1 ' $OUTPUT_BASE ' /external/#g ' < " $fname " >> $JSON_OUT
1314 echo " " >> $JSON_OUT
1415done
1516
You can’t perform that action at this time.
0 commit comments