Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use find_package for the compression libraries when vcpkg is enabled. #4500

Merged
merged 3 commits into from
Nov 13, 2023

Conversation

teo-tsirpanis
Copy link
Member

All of our compression libraries provide native CMake integration with find_package. This PR makes use of it when vcpkg is enabled.


TYPE: BUILD
DESC: Use the provided CMake packages to import the compression libraries when vcpkg is enabled.

The targets were renamed to match the casing.
We cannot use an alias target to choose the correct linkage for zstd, as long as `TILEDB_INSTALL_STATIC_DEPS` exists.
@teo-tsirpanis teo-tsirpanis marked this pull request as ready for review November 8, 2023 18:50
@eddelbuettel
Copy link
Contributor

Am I reading this correctly as in "vcpkg will now once again use system libraries for these three compressor libraries" ?

@teo-tsirpanis
Copy link
Member Author

No, the libraries will still be provided by vcpkg. The ports for lz4 and zstd provide CMake config files that will be directly used by find_package, while bzip2 has a built-in find module that uses find_library, which still resolves to the vcpkg binaries.

image

@KiterLuc KiterLuc merged commit 3a4ed9c into TileDB-Inc:dev Nov 13, 2023
52 checks passed
@teo-tsirpanis teo-tsirpanis deleted the find_package-compressors branch November 13, 2023 13:14
KiterLuc pushed a commit that referenced this pull request Nov 16, 2023
> [!NOTE]
> ~~Depends on #4500.~~


[SC-36531](https://app.shortcut.com/tiledb-inc/story/36531/remove-tiledb-install-static-deps)

This PR removes the now-unused `TILEDB_INSTALL_STATIC_DEPS` option and
all the infrastructure supporting it. This frees us from having to
reason about the dependencies of our dependencies (at least when vcpkg
is enabled), and allows us to more easily update libraries in the future
(for example updating Curl after that will be a piece of cake).

Instead of installing our static dependencies, we let the consuming
project find them at configure time through the
[`find_dependency`](https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html)
command[^1]. This matches what
[other](https://github.com/Azure/azure-sdk-for-cpp/blob/0ca8a1d9d5726be74ba0985e69c711af6b4a89b2/sdk/core/azure-core/vcpkg/Config.cmake.in#L6-L19)
[CMake](https://github.com/curl/curl/blob/9fb6cc54c59760bee23c730f668653895e713a25/CMake/curl-config.cmake.in#L26-L32)
[libraries](https://github.com/googleapis/google-cloud-cpp/blob/43c6142d5b802deb07f8e3094e13367a6219a844/google/cloud/config.cmake.in#L15-L18)
do.

I tested this by successfully running the static linkage tests. I also
ran a full build with every feature enabled and vcpkg disabled, to make
sure the legacy build does not get broken, and will also trigger a
nightly build run.

[^1]: One possible place to find them is vcpkg; in fact this is what we
do in the static linkage tests: we pass `vcpkg_installed` to the CMake
prefix path, and all these calls to `find_dependency` will be resolved
from there.

---
TYPE: BUILD
DESC: Remove bundling our static library dependencies; they are now
found from the CMake config file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants