Compiling clangd to WebAssembly

Hi all,

As a learning exercise I am trying to compile clangd as a WebAssembly target, with the eventual goal of using it as a Language Server in conjunction with monaco, the code editor behind Visual Studio Code.

So far I’ve successfully built all combinations of LLVM, clang and clangd on macOS and Ubuntu. The build system is very easy to use, but rather complex to understand for someone with limited experience like myself.

Are there any pointers to help me better understand clangd’s Makefile? Walking up the tree of parent files and environment variables hasn’t brought any clarity.

P.S. before I got any further, has anyone else tried this?

Jonathan Beri.

Hi Jonathan,

We don’t have any clangd-specific extensions to the buildsystem used by LLVM, the CMakeLists.txt inside clangd directories merely list the libraries and binaries we need to build.

I don’t think any of clangd developers ever tried building it for WebAssembly, so we’re probably not of much help here.

You might have better luck asking on the LLVM and clang mailing lists (llvm-dev and cfe-dev, respectively). If anyone successfully built clang for WebAssembly, building clangd the same way should probably work.