mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
Documentation: Add a note about clang plugins
This commit is contained in:
parent
e76e48421f
commit
a4e814578b
Notes:
github-actions[bot]
2024-08-28 13:37:43 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/a4e814578bf Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1212
1 changed files with 16 additions and 0 deletions
|
@ -30,6 +30,7 @@ There are some optional features that can be enabled during compilation that are
|
|||
- `INCLUDE_FLAC_SPEC_TESTS`: downloads and includes the xiph.org FLAC test suite.
|
||||
- `SERENITY_CACHE_DIR`: sets the location of a shared cache of downloaded files. Should not need to be set manually unless managing a distribution package.
|
||||
- `ENABLE_NETWORK_DOWNLOADS`: allows downloading files from the internet during the build. Default on, turning off enables offline builds. For offline builds, the structure of the SERENITY_CACHE_DIR must be set up the way that the build expects.
|
||||
- `ENABLE_CLANG_PLUGINS`: enables clang plugins which analyze the code for programming mistakes.
|
||||
|
||||
Many parts of the codebase have debug functionality, mostly consisting of additional messages printed to the debug console. This is done via the `<component_name>_DEBUG` macros, which can be enabled individually at build time. They are listed in [this file](../Meta/CMake/all_the_debug_macros.cmake).
|
||||
|
||||
|
@ -80,3 +81,18 @@ etc), the path to the compilation database in that file may not be
|
|||
correct. The result is that clangd will have a difficult time
|
||||
understanding all your include directories. To resolve the problem, you
|
||||
can use the `Meta/configure-clangd.sh` script.
|
||||
|
||||
## Clang Plugins
|
||||
|
||||
Clang plugins are used to validate the code at compile time. Currently, they are used to detect JavaScript-related
|
||||
garbage collection faux pas, such as neglecting to visit a garbage-collected type.
|
||||
|
||||
When clang plugins are enabled, it is recommended to have the following environment variable set for ccache:
|
||||
|
||||
```bash
|
||||
export CCACHE_COMPILERCHECK="%compiler% -v"
|
||||
```
|
||||
|
||||
By default, ccache will include the plugins themselves in file hashes. So if a plugin changes, the hash of every file
|
||||
will change, and you will be stuck with an uncached build. This setting will prevent ccache from using plugins in the
|
||||
file hashes.
|
||||
|
|
Loading…
Reference in a new issue