rocksdbconfig.cmake - improve locating zstd packages #13975
+6
−2
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.
Original problem I've met - on Windows configuring project that has
find_package(RocksDB REQUIRED CONFIG)
withresulted in
Investigating I've found two issues and fixed in this PR:
zstd_static
, which wasn't considered inFindzstd.cmake
.https://github.com/facebook/zstd/blob/d190b3886305f0fb894cd648da6a6d9ecda56f64/build/cmake/lib/CMakeLists.txt#L197-L202
zstdconfig.cmake
to locate headers and libraries automatically) were not supported. Since it's more modern way to include packages in cmake, it makes sense to check for them first and then fallback to good old modules.I've used
find_package(zstd CONFIG QUIET)
, unlike i.efind_dependency(Snappy CONFIG)
used for other dependencies, otherwise ifRocksDB
isREQUIRED
thenREQUIRED
status is propagated byfind_dependency
and it would fail on trying to locateCONFIG
and would never get to module.@xingbowang can you please take a look?