Skip to content

[Build] Document USE_CXL and ENABLE_MULTI_PROTOCOL as CMake options#8

Open
stmatengss wants to merge 1 commit intohemist/cxl-level-storefrom
fix/cmake-enable-multi-protocol-option
Open

[Build] Document USE_CXL and ENABLE_MULTI_PROTOCOL as CMake options#8
stmatengss wants to merge 1 commit intohemist/cxl-level-storefrom
fix/cmake-enable-multi-protocol-option

Conversation

@stmatengss
Copy link
Copy Markdown

Problem

USE_CXL and ENABLE_MULTI_PROTOCOL were undocumented compile-time flags only discoverable by reading #ifdef guards in source code. They had no option() declarations, no help strings, and no add_compile_definitions() wiring in CMake. Users had to pass them as opaque -D flags with no guidance.

Fix

Add option() declarations with descriptive help strings and add_compile_definitions() in the top-level CMakeLists.txt, following the same pattern as STORE_USE_ETCD and STORE_USE_REDIS. Also add a message(WARNING) when ENABLE_MULTI_PROTOCOL=ON without USE_CXL=ON since the former requires the latter.

Usage after this change

# CXL memory tier only
cmake -DUSE_CXL=ON ..

# CXL + multi-protocol tiered storage (CXL+TCP or CXL+RDMA)
cmake -DUSE_CXL=ON -DENABLE_MULTI_PROTOCOL=ON ..

# cmake --help-cache will now show both options with descriptions

Impact

  • No behavior change when flags are not set (both default to OFF)
  • cmake-gui and ccmake will now show these options
  • Dependency relationship between the two flags is now explicitly warned about

USE_CXL and ENABLE_MULTI_PROTOCOL were undocumented compile flags that
could only be discovered by reading #ifdef guards in source files. Add
proper option() declarations in the top-level CMakeLists.txt with
descriptive help strings, add_compile_definitions() wiring, and a
dependency warning when ENABLE_MULTI_PROTOCOL is ON without USE_CXL.

Build examples:
  cmake -DUSE_CXL=ON ..
  cmake -DUSE_CXL=ON -DENABLE_MULTI_PROTOCOL=ON ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant