Skip to content
File

Blob: tools/windows/create-external.bat

999 bytes
1@ECHO off
2SETLOCAL EnableDelayedExpansion
3 
4@REM cmd.exe script to ensure external/ directory is present for clangd.
5 
6FOR /f %%i IN ('bazel info output_path') do SET "output_path=%%i"
7FOR /f %%i IN ('bazel info workspace') do SET "workspace=%%i"
8SET "external=%output_path%\..\..\..\external"
9 
10@REM Delete the convenience junction external if it exists (it maybe stale if it does).
11rmdir "%workspace%\external" 2>NUL
12 
13@REM Create the convenience junction external anew for easy access to sources and for
14@REM VSCode to be able to open files at points of error when compilation fails.
15MKLINK /J "%workspace%\external" "%external%"
16 
17SET "compile_commands=%workspace%\compile_commands.json"
18IF EXIST "%compile_commands%" (
19 ECHO.WARNING: This workspace has a compile_commands.json file, but workerd
20 ECHO.has moved to using compile_flags.txt for clangd instead. To improve
21 ECHO.code completion and navigation in your editor, consider running:
22 ECHO.
23 ECHO. DEL /q "%compile_commands%"
24 ECHO.
25)