]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common: extract options into yaml
authorKefu Chai <kchai@redhat.com>
Fri, 9 Apr 2021 10:54:46 +0000 (18:54 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 13 Apr 2021 01:13:47 +0000 (09:13 +0800)
commit5ddda38da4f3c8ab8ff9c1a501bcd54df558fb80
tree3253187b2f856ec931ff11298c84ea435bbefa3c
parent3bee4b02611459b9ae949cebf5967e4d83ef55de
common: extract options into yaml

extract the options in common/options.cc into separate .yaml.in
files, and preprocess them using CMake before translating them into .cc
files using a python script.

this change paves the road to render the options using sphinx, and
will allow us to further annotate the options to include more metadata.

also, a this YAML file can be consumed by applications like dashboard
and Sphinx to consume these metadata in a simpler way.

* use @variable-name@ for substituting the variables in .yaml.in file
* use cmake variable of `mgr_disabled_modules` instead of C macro
  to define `mgr_disabled_modules` in global.yaml.in
* debian/control, ceph.spec.in, win32_deps_build.sh: add python3-yaml
  as build dep
* add y2c.py (short for YAML to C++) to translate .yaml to .cc file
* common/options/*.yaml.in: extract and split options into .yaml.in
  files, the subvars in it is then replaced with CMake variables,
  and copied to the corresponding .yaml files
* include/config-h.in.cmake: remove MGR_DISABLED_MODULES, as it
  is not a CMake variable.

Signed-off-by: Kefu Chai <kchai@redhat.com>
22 files changed:
CMakeLists.txt
ceph.spec.in
debian/control
src/CMakeLists.txt
src/common/CMakeLists.txt
src/common/options.cc
src/common/options.h
src/common/options/CMakeLists.txt [new file with mode: 0644]
src/common/options/build_options.cc [new file with mode: 0644]
src/common/options/build_options.h [new file with mode: 0644]
src/common/options/cephfs-mirror.yaml.in [new file with mode: 0644]
src/common/options/global.yaml.in [new file with mode: 0644]
src/common/options/immutable-object-cache.yaml.in [new file with mode: 0644]
src/common/options/mds-client.yaml.in [new file with mode: 0644]
src/common/options/mds.yaml.in [new file with mode: 0644]
src/common/options/rbd-mirror.yaml.in [new file with mode: 0644]
src/common/options/rbd.yaml.in [new file with mode: 0644]
src/common/options/rgw.yaml.in [new file with mode: 0644]
src/common/options/y2c.py [new file with mode: 0755]
src/crimson/CMakeLists.txt
src/include/config-h.in.cmake
win32_deps_build.sh