-
Notifications
You must be signed in to change notification settings - Fork 0
CLion Setup
Source:
docs/clion.mdin the main repository.
This project is CMake-first. CLion should load CMake Presets so every target, include path, and generated header participates in the code model.
-
File → Open → select the repository root (folder with
CMakeLists.txt). - When prompted, choose Open as CMake project (not “Open as Directory” only).
- In the CMake tool window / Settings → Build, Execution, Deployment → CMake:
- Enable CMake presets
- Profile:
clion-debug(recommended) - Alternative:
clion-release,clion-relwithdebinfo
Presets live in CMakePresets.json.
Copy and edit if your prefixes differ:
cp CMakeUserPresets.json.example CMakeUserPresets.json
# edit CMAKE_PREFIX_PATH / HOMEBREW_PREFIXCMakeUserPresets.json is gitignored.
Default macOS Apple Silicon prefix: /opt/homebrew.
make install-industry # hwloc flatbuffers google-benchmark mimalloc
# base deps: see READMECLion indexes symbols from translation units in CMake targets. Header-only
ll::* APIs are pulled into a dedicated target so types are always visible:
| Target | Purpose |
|---|---|
ide_index |
Includes all ll/*, SBE, Asio, Beast, TBB, Taskflow, simdjson, … |
lib_smoke |
Full mesh runtime smoke |
test_* |
Tests (also excellent for navigation) |
cmake --preset clion-debug
cmake --build --preset ide-index
# or in CLion: select target ide_index → BuildAfter a successful Reload CMake Project, you should get:
- Completion on
ll::SpscQueue,ll::HdrHistogramC,market::sbe::Tick, … - Go-to-definition into
include/ll/*.hppandgenerated/sbe/market_sbe/ - Macro-aware branches (
LL_HAS_*) matching your configure
Presets set CMAKE_EXPORT_COMPILE_COMMANDS=ON. After configure:
build/clion-debug/compile_commands.json
Optional convenience (also used by Makefile):
make clion # configure clion-debug + link compile_commands.json at repo root.clangd points at build/clion-debug for clangd-based tooling.
If present under .idea/runConfigurations/, CLion offers ready-made runs for:
lib_smokeide_indextest_roadmap_stackexample_sbe_codegen
Otherwise: Run → Edit Configurations → + → CMake Application and pick the target.
| Symptom | Fix |
|---|---|
| Red code in headers only | Build ide_index or open a .cpp that includes them |
| Missing Homebrew packages |
make deps-check / make install-industry
|
| Wrong C++ standard | Preset forces C++26; check CMake output |
| SBE types missing | Ensure generated/sbe/market_sbe/*.h exists; STACK_WITH_SBE_CODEGEN=ON
|
| Stale index | Tools → CMake → Reset Cache and Reload Project |
| Folly/HPX types missing | Configure with LIB_SMOKE_WITH_FOLLY=ON / HPX (optional profiles) |
Under Targets after reload:
-
ide_index,lib_smoke,smoke_deps,ll_headers,stack_industry - All
test_*,example_*, optionalbench_queues - Headers under
include/ll/andgenerated/sbe/(viaFILE_SET HEADERS)
make clion # cmake --preset clion-debug + compile_commands link
make clion-index # build ide_index
make clion-test # ctest on clion-debug build treeWiki mirror of repository docs. Edit docs/ in the main repo, then python3 scripts/publish_wiki.py.