Skip to content

CLion project setup

Timur Yusupov edited this page Feb 3, 2020 · 1 revision

There are two options for build system to use with YugabyteDB:

  • make - this is well-supported by CLion, but slower for rebuild comparing to ninja.
  • ninja - faster alternative, but CLion has limited support for ninja (for example it doesn’t allow to rebuild individual files https://youtrack.jetbrains.com/issue/CPP-17622)

Following steps are needed for configuring CLion project for YugabyteDB:

  1. Use “File / Open…” to open the project root directory.
  2. Put build/debug-clang-dynamic (or build/debug-clang-dynamic-ninja if you want to use ninja) as a “Generation path” in “Preferences/Build, Execution, Deployment/CMake”: If you want to build with ninja, use build/debug-clang-dynamic-ninja as a generation path and add -G Ninja into “CMake options”:
  3. 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.
  4. 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
  1. Subsequent builds could be launched from CLion.