]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
cmake: targets against legacy-option-headers when appropriate
authorKefu Chai <tchaikov@gmail.com>
Sat, 27 Apr 2024 11:58:26 +0000 (19:58 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 8 May 2024 14:44:00 +0000 (22:44 +0800)
commit5e51bc4463605adcbe6c8342063f4426c9754347
tree5232aff49d5ef9886ef35ea5f215e659acca75a2
parentc24a6ffe20568d74f75af09bc83c636f51a2d3a2
cmake: targets against legacy-option-headers when appropriate

legacy-option-headers provides the headers included by
`src/common/options/legacy_config_opts.h`. these headers are generated from
corresponding .yaml.in file. because these headers file are generated at
build time, we need to construct the file-level dependencies between the
targets using them and these headers, otherwise the compiler could fail
to compile the tree if any of the headers are not generated yet, when
compiling .cc file which (indirectly) includes it.

in order to address this, in this change, we

1. search for all .cc files which have `#include "common/config.h"` in it
2. and find out the targets building the .cc file, then
3. add `legacy-option-headers` to its linkage using CMake

this should partially address the above race condition we've been running
into on slow build hosts.

because we have not audited the .h files including `common/config.h`,
this change should be considered a partial fix.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
17 files changed:
src/client/CMakeLists.txt
src/compressor/lz4/CMakeLists.txt
src/compressor/snappy/CMakeLists.txt
src/crimson/osd/CMakeLists.txt
src/dokan/CMakeLists.txt
src/librados/CMakeLists.txt
src/mds/CMakeLists.txt
src/mon/CMakeLists.txt
src/msg/CMakeLists.txt
src/os/CMakeLists.txt
src/osd/CMakeLists.txt
src/rgw/CMakeLists.txt
src/tools/CMakeLists.txt
src/tools/cephfs/CMakeLists.txt
src/tools/immutable_object_cache/CMakeLists.txt
src/tools/rbd_mirror/CMakeLists.txt
src/tools/rbd_wnbd/CMakeLists.txt