-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change moves to using compile_flags.txt with clangd rather than compile_commands.json. o Adds compile_flags.txt. o Drops support for generating compile_commands.json with Bazel. o Add script to create the ${workspaceFolder}/external/ symlink that compile_flags.txt uses. Bug: #506
- Loading branch information
Showing
8 changed files
with
149 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
-std=c++20 | ||
-stdlib=libc++ | ||
-xc++ | ||
-nostdinc | ||
-Ibazel-bin | ||
-Ibazel-bin/external/capnp-cpp/src | ||
-Ibazel-bin/external/com_googlesource_chromium_base_trace_event_common/_virtual_includes/trace_event_common | ||
-Iexternal/capnp-cpp/src | ||
-Isrc | ||
-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include | ||
-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 | ||
-isystemC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include | ||
-isystemc:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt | ||
-isystembazel-bin/external/v8 | ||
-isystembazel-bin/external/v8/icu | ||
-isystembazel-bin/src | ||
-isystemexternal/brotli/c/include | ||
-isystemexternal/com_googlesource_chromium_icu/source/common | ||
-isystemexternal/icu | ||
-isystemexternal/ssl/src/include | ||
-isystemexternal/v8 | ||
-isystemexternal/v8/include | ||
-isystemexternal/zlib | ||
-D_FORTIFY_SOURCE=1 | ||
-DBAZEL_CURRENT_REPOSITORY=\"\" | ||
-DCAPNP_VERSION=11000 | ||
-DDEBUG | ||
-DGOOGLE3 | ||
-DHAVE_DLOPEN=0 | ||
-DKJ_HAS_LIBDL | ||
-DKJ_HAS_OPENSSL | ||
-DKJ_HAS_ZLIB | ||
-DKJ_SAVE_ACQUIRED_LOCK_INFO=0 | ||
-DKJ_TRACK_LOCK_BLOCKING=0 | ||
-DSQLITE_ENABLE_FTS5 | ||
-DSQLITE_ENABLE_NORMALIZE | ||
-DSQLITE_MAX_ALLOCATION_SIZE=16777216 | ||
-DSQLITE_PRINTF_PRECISION_LIMIT=100000 | ||
-DUCONFIG_ONLY_HTML_CONVERSION=1 | ||
-DUNISTR_FROM_CHAR_EXPLICIT= | ||
-DUNISTR_FROM_STRING_EXPLICIT= | ||
-DUSE_CHROMIUM_ICU=1 | ||
-DU_CHARSET_IS_UTF8=1 | ||
-DU_COMMON_IMPLEMENTATION | ||
-DU_ENABLE_DYLOAD=0 | ||
-DU_ENABLE_RESOURCE_TRACING=0 | ||
-DU_ENABLE_TRACING=1 | ||
-DU_I18N_IMPLEMENTATION | ||
-DU_ICUDATAENTRY_IN_COMMON | ||
-DU_USING_ICU_NAMESPACE=0 | ||
-DV8_31BIT_SMIS_ON_64BIT_ARCH | ||
-DV8_ADVANCED_BIGINT_ALGORITHMS | ||
-DV8_COMPRESS_POINTERS | ||
-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE | ||
-DV8_CONCURRENT_MARKING | ||
-DV8_DEPRECATION_WARNINGS | ||
-DV8_ENABLE_CHECKS | ||
-DV8_ENABLE_LAZY_SOURCE_POSITIONS | ||
-DV8_ENABLE_TURBOFAN | ||
-DV8_ENABLE_WEBASSEMBLY | ||
-DV8_HAVE_TARGET_OS | ||
-DV8_IMMINENT_DEPRECATION_WARNINGS | ||
-DV8_SHORT_BUILTIN_CALLS | ||
-DV8_TARGET_ARCH_X64 | ||
-DV8_TARGET_OS_LINUX | ||
-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 | ||
-DWORKERD_ICU_DATA_EMBED | ||
-Wall | ||
-Werror=dangling | ||
-Werror=implicit-fallthrough | ||
-Werror=return-stack-address | ||
-Werror=return-type | ||
-Werror=switch | ||
-Werror=uninitialized | ||
-Werror=unreachable-code | ||
-Werror=unused-function | ||
-Werror=unused-lambda-capture | ||
-Werror=unused-variable | ||
-Wextra | ||
-Wno-builtin-macro-redefined | ||
-Wno-free-nonheap-object | ||
-Wno-ignored-qualifiers | ||
-Wno-missing-field-initializers | ||
-Wno-sign-compare | ||
-Wno-strict-aliasing | ||
-Wno-unused-parameter | ||
-Wself-assign | ||
-Wthread-safety | ||
-Wunused-but-set-parameter | ||
-Wunused-function | ||
-Wunused-lambda-capture | ||
-Wunused-variable | ||
-no-canonical-prefixes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
# Create a symlink to Bazel's external/ directory. This simplifies the | ||
# paths provided to clangd in compile_flags.txt for language server | ||
# use. | ||
|
||
output_path=$(bazel info output_path) | ||
workspace=$(bazel info workspace) | ||
external="${workspace}/external" | ||
ln -sfF "${output_path}/../../../external" "${external}" | ||
|
||
# Temporary warning that compile_commands.json exists and will | ||
# interfere with the intended clangd setup. | ||
compile_commands="${workspace}/compile_commands.json" | ||
if [ -f "compile_commands.json" ] ; then | ||
cat<<COMPILE_COMMANDS_WARNING | ||
WARNING: This workspace has a compile_commands.json file, but workerd | ||
has moved to using compile_flags.txt for clangd instead. To improve | ||
code completion and navigation in your editor, consider running: | ||
rm "${compile_commands}" | ||
COMPILE_COMMANDS_WARNING | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@ECHO off | ||
SETLOCAL EnableDelayedExpansion | ||
|
||
@REM cmd.exe script to ensure external/ directory is present for clangd. | ||
|
||
FOR /f %%i IN ('bazel info output_path') do SET "output_path=%%i" | ||
FOR /f %%i IN ('bazel info workspace') do SET "workspace=%%i" | ||
SET "external=%output_path%\..\..\..\external" | ||
|
||
IF NOT EXIST "%workspace%\external" ( | ||
mklink /J "%workspace%\external" "%external%" | ||
) | ||
|
||
set "compile_commands=%workspace%\compile_commands.json" | ||
if EXIST "%compile_commands%" ( | ||
del /q "%compile_commands%" | ||
) |