File
Blob: tools/unix/create-external.sh
| 1 | #!/bin/sh |
| 2 | |
| 3 | # Create a symlink to Bazel's external/ directory. This simplifies the |
| 4 | # paths provided to clangd in compile_flags.txt for language server |
| 5 | # use. |
| 6 | |
| 7 | output_path=$(bazel info output_path) |
| 8 | workspace=$(bazel info workspace) |
| 9 | external="${workspace}/external" |
| 10 | ln -sfF "${output_path}/../../../external" "${external}" |
| 11 | |
| 12 | # Temporary warning that compile_commands.json exists and will |
| 13 | # interfere with the intended clangd setup. |
| 14 | compile_commands="${workspace}/compile_commands.json" |
| 15 | if [ -f "compile_commands.json" ] ; then |
| 16 | cat<<COMPILE_COMMANDS_WARNING |
| 17 | WARNING: This workspace has a compile_commands.json file, but workerd |
| 18 | has moved to using compile_flags.txt for clangd instead. To improve |
| 19 | code completion and navigation in your editor, consider running: |
| 20 | |
| 21 | rm "${compile_commands}" |
| 22 | |
| 23 | COMPILE_COMMANDS_WARNING |
| 24 | fi |