-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Building rippled codebase with CLion IDE
I faced some issues in setting up the CLion IDE to work with the Conan build system. I'm hoping this document will alleviate some of those problems. Try to build rippled code through your terminal to ensure that there are no dependency issues. Relevant instructions can be found here
The following works in CLion v2023.1.1
Go to the root of rippled directory and execute the following commands to remove traces of previous compilation runs.
rm -rf .idea
rm -rf cmake-build-*
rm -rf cmake-release-*
rm -rf CMakeUserPresets.json
- CLion Toolbar -> File -> Invalidate Caches (click both options)
- Remove the project from the CLion Quickstart menu
CLion can be configured to run rippled through updating the CMake settings or by enabling a Compilation Database. But do not include both these alternatives at the same time.
- make sure the "Build type" field matches the one you passed to
conan install
command here - make sure you pass
-DCMAKE_TOOLCHAIN_FILE
in the "CMake options" field just like the instructions say in the above webpage. - The
Toolchain
andGenerator
fields can be left with the defaults.
Here is a sample image of my CMake settings
You can use the following command to generate a compile_commands.json
file:
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..
Then, open the clion project with the compile_commands.json file. Make sure to go into Tools -> Compilation Database -> Change Project Root
after import.
If CMake is configured correctly, you should be able to see a toolbar with green icons for build and run.