mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Toolchain+Docs: Improve the way to enable clangd
Allowing an environment variable to enable/disable the build for clangd and other toolchains will improve the developer-experience than reconfiguring and building the toolchain manually. Now you will have to call the command as following $ CLANG_ENABLE_CLANGD=ON Toolchain/BuildClang.sh
This commit is contained in:
parent
2d5cb1e02d
commit
e444b0aace
Notes:
sideshowbarker
2024-07-18 04:46:35 +09:00
Author: https://github.com/tbhaxor Commit: https://github.com/SerenityOS/serenity/commit/e444b0aace Pull-request: https://github.com/SerenityOS/serenity/pull/23908 Reviewed-by: https://github.com/ADKaster
2 changed files with 8 additions and 5 deletions
|
@ -224,10 +224,7 @@ clangd that are aware of SerenityOS as a valid target. These tools will be insta
|
||||||
the script. Pointing your editor's plugins to the custom-built clang tools and a ``compile_commands.json`` from a clang build
|
the script. Pointing your editor's plugins to the custom-built clang tools and a ``compile_commands.json`` from a clang build
|
||||||
of Serenity can enable richer error reporting than the tools that are installed for the build host.
|
of Serenity can enable richer error reporting than the tools that are installed for the build host.
|
||||||
|
|
||||||
To enable building clangd as part of the clang toolchain, set ``CLANG_ENABLE_CLANGD`` to ON in
|
To enable building clangd as part of the clang toolchain, set ``CLANG_ENABLE_CLANGD`` environment variable to ``ON``, then run ``Toolchain/BuildClang.sh``.
|
||||||
``Toolchain/CMake/LLVMConfig.cmake`` before running BuildClang.sh. If you already built the clang toolchain and would like to
|
|
||||||
enable the custom clangd build, change the CMake cache variable ``CLANG_ENABLE_CLANGD`` to ON in ``Toolchain/Build/clang/llvm``
|
|
||||||
and re-install with ``cd Toolchain/Build/clang/llvm && cmake ../../../Tarballs/llvm-project-$LLVM_VERSION.src/llvm -DCLANG_ENABLE_CLANGD=ON && ninja install/strip``, where $LLVM_VERSION should be tab-completable in your shell.
|
|
||||||
|
|
||||||
## Clang-format updates
|
## Clang-format updates
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,13 @@ set(LLVM_INSTALL_UTILS ON CACHE BOOL "")
|
||||||
set(LLVM_INSTALL_TOOLCHAIN_ONLY OFF CACHE BOOL "Don't install headers, utils, and tools")
|
set(LLVM_INSTALL_TOOLCHAIN_ONLY OFF CACHE BOOL "Don't install headers, utils, and tools")
|
||||||
set(LLVM_INSTALL_BINUTILS_SYMLINKS OFF CACHE BOOL "")
|
set(LLVM_INSTALL_BINUTILS_SYMLINKS OFF CACHE BOOL "")
|
||||||
|
|
||||||
set(CLANG_ENABLE_CLANGD OFF CACHE BOOL "")
|
if(DEFINED ENV{CLANG_ENABLE_CLANGD} AND "$ENV{CLANG_ENABLE_CLANGD}" STREQUAL "ON")
|
||||||
|
message(STATUS "Enabling clangd as a part of toolchain build")
|
||||||
|
set(CLANG_ENABLE_CLANGD ON CACHE BOOL "" FORCE)
|
||||||
|
else()
|
||||||
|
message(STATUS "Disabling clangd as a part of toolchain build")
|
||||||
|
set(CLANG_ENABLE_CLANGD OFF CACHE BOOL "" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(target x86_64-pc-serenity;aarch64-pc-serenity;riscv64-pc-serenity)
|
foreach(target x86_64-pc-serenity;aarch64-pc-serenity;riscv64-pc-serenity)
|
||||||
list(APPEND targets "${target}")
|
list(APPEND targets "${target}")
|
||||||
|
|
Loading…
Reference in a new issue