Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on windows does not work as described in wiki #964

Open
Frederico-Esch opened this issue May 29, 2024 · 1 comment
Open

Building on windows does not work as described in wiki #964

Frederico-Esch opened this issue May 29, 2024 · 1 comment

Comments

@Frederico-Esch
Copy link

The build steps described here: wiki/Project-Setup do not work anymore.

Somethings I did to actually build it.

  • Mingw apparently does not work as explained there, and I could not make it work anyway.
  • I could build ccls, building llvm from source, but I had to change somethings
  1. Make sure you do not have any clang in your path, be it from Visual Studio or llvm-binaries (I don't know if this step is necessary, but for me it was causing some conflict)
  2. Build llvm with:
git clone https://github.com/llvm/llvm-project.git --depth=1
cd llvm-project
cmake -Sllvm -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PROJECTS=clang
ninja -C Release clangFormat clangFrontendTool clangIndex clangTooling clang

Somethings to take note, the -H flag does not exist anymore, it is now -S, building llvm was pretty straight-forward if you knew about the flag deprecation.

  1. Build ccls with:
git clone https://github.com/MaskRay/ccls.git
cd ccls

git submodule init
git submodule update

cmake -S. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_PREFIX_PATH="E:/Aplicativos/llvm-project/Release"
ninja -C Release

I had to initialize and update the submodule to actually make it work. About the cmake call, I had to change the -H to -S as stated before, and another relevant thing was setting both the CXX and C compiler to clang, since if you don't define CMAKE_C_COMPILER it will automatically use MSVC and it will conflict and abort the build.

I don't know how to push a fix to wiki so I'm just submitting a issue with the fix that worked for me, if anyone wants to validate by trying to replicate it and update the wiki I'd be thankful.

@LdBeth
Copy link

LdBeth commented Aug 17, 2024

The Wiki is open for editing, so I have fixed that for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants