Configure a CLion project

There are two options for build systems that you can use with YugabyteDB, cmake and ninja.

  • make is well-supported by CLion, but slower for rebuild comparing to ninja.
  • ninja is faster, but CLion has limited support for ninja (for example, it doesn’t allow you to rebuild individual files).

Configure a CLion project for YugabyteDB

  • Click File > Open… to open the project root directory.
  • Select build/debug-clang-dynamic (or build/debug-clang-dynamic-ninja if you want to use ninja) as the Generation path in Preferences > Build, Execution, Deployment/CMake”:

If you want to build with ninja, put build/debug-clang-dynamic-ninja in Generation path and add -G Ninja into “CMake options”:

CLion cmake options

If you want to build with ninja, use build/debug-clang-dynamic-ninja as a “Generation path” and add -G Ninja into “CMake options”:

Clion ninja options

  • Use “File / Reload CMake Project” - it should start building third party dependencies for YugabyteDB.Building a third party can take tens of minutes and then CLion will start updating symbols which also can take a while.

  • Run from the command line inside project root (omit YB_USE_NINJA=0 if you want to use ninja):

YB_USE_NINJA=0 ./yb_build.sh

Subsequent builds can be launched also from CLion.