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:
Gurkirat Singh
2024-04-10 02:29:25 +05:30
committed by Andrew Kaster
parent 2d5cb1e02d
commit e444b0aace
2 changed files with 8 additions and 5 deletions

View File

@@ -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_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)
list(APPEND targets "${target}")