build: add compiler and C++ standard compatibility checks #2463
+26
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
we install
SeastarConfig.cmake
so that a Seastar project can consume the Seastar libraries usingfind_package(Seastar)
. this CMake config file checks for the dependencies used by CMake, and defines the Seastar libraries to be consumed by the parent project. one of the dependence is detected using FindSourceLocation.cmake, which is also shipped along with Seastar, this find module is provided so that we can detect the C++ compiler support ofstd::source_location
related features. But the result of the detection depends on the C++ standard used, which is default to the one configured by the used C++ compiler if not specified. if the parent project consumes precompiled Seastar libraries, and use a differnt C++ standard, the parent project could fail to build, because Seastar and parent project are using different compiling options.mismatches in C++ standards or compilers between Seastar and the parent project can lead to build failures or runtime issues. while not always problematic, these mismatches can cause unexpected behavior.
in this change, we detect
warnings are non-fatal as compatibility is possible in some cases, but developers should be aware of potential issues and test thoroughly.
Fixes #2181
Signed-off-by: Kefu Chai [email protected]