Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: do not export valgrind with export()
in Seastar, valgrind library is only used at the build time, and is used internally for accessing its header files when buildings its internal .cc files. so we don't expect to expose it via `export()`, for exposing it in `SeastarTargets.cmake`. but somehow when building Seastar as a static library, valgrind is still exposed in Seastar's CMake configuration file. if a CMake based project consume Seastar using its CMake configuration file, it runs into following failure when CMake generates the building system: ``` -- Configuring done (2.5s) CMake Error at external/seastar/build/release/SeastarTargets.cmake:52 (set_target_properties): The link interface of target "Seastar::seastar" contains: Valgrind::valgrind but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. Call Stack (most recent call first): external/seastar/build/release/SeastarConfig.cmake:36 (include) CMakeLists.txt:6 (find_package) ``` fortunately, in CMake 3.26, `BUILD_LOCAL_INTERFACE` was introduced this problem in specific, so that the linked library is not included by `export()` anymore. in this change, we include `Valgrind::valgrind` using this generator expression if the CMake's version is greater or equal to 3.26, so that `Valgrind` is not required for building Seastar applications. as this generator expression is not available on CMake versions lower than 3.26, and the minimal required CMake version for building Seastar is 3.13, and Seastar does support static build. The issue is still not fully addressed even with this change with older CMake and if Seastar is built as a static library. previously, 372a16a intended to address this. but somehow Valgrind is still exposed by SeastarTargets.cmake. Refs scylladb#2180 Signed-off-by: Kefu Chai <[email protected]>
- Loading branch information