ccls icon indicating copy to clipboard operation
ccls copied to clipboard

Out of Tree builds: project root discovery

Open Thaodan opened this issue 2 years ago • 3 comments

Observed behavior

When a project uses out of tree builds like in a ./build/. directory inside the project folder compile_commands.json are not in the project folder but in that folder. How should such use cases be handled?

Expected behavior

ccls would describe what is the project root, the build folder or the actual project root or handle projects with out of tree build folders.

Steps to reproduce

Generate a project that uses an out of tree build. Like for cmake with Cmake:

  1. cmake -S $PWD -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=YES
  2. How to tell ccsl about the out of tree build?

Thaodan avatar Sep 16 '22 20:09 Thaodan

something like this https://github.com/MaskRay/ccls/wiki/Visual-Studio-Code#cclsmisccompilationdatabasedirectory ?

FederAndInk avatar Sep 16 '22 22:09 FederAndInk

see https://github.com/MaskRay/ccls/wiki/Project-Setup#compile_commandsjson you should be able to use compilationDatabaseDirectory

FederAndInk avatar Sep 16 '22 22:09 FederAndInk

something like this https://github.com/MaskRay/ccls/wiki/Visual-Studio-Code#cclsmisccompilation databasedirectory ?

Yes exactly. Can this be more generalized or has this to be supported by each editor plugin?

Thaodan avatar Sep 16 '22 22:09 Thaodan