diff options
author | ambrosin <ambrosin@google.com> | 2022-01-26 09:40:06 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-01-26 09:40:54 -0800 |
commit | 03ec244cd9b99f10073264f9f32fcc60d7f2577f (patch) | |
tree | 9cbcbeb9d49361bedcd8d5aaecafe3b9548d0515 /cmake | |
parent | 06a676eb1e3f72751f2609c2a0ca30c5ad674ead (diff) | |
download | tink-03ec244cd9b99f10073264f9f32fcc60d7f2577f.tar.gz |
Add option `TINK_USE_INSTALLED_ABSEIL` to build Tink against an installed version of Abseil.
`TINK_USE_INSTALLED_ABSEIL` is set to OFF by default. Abseil can be installed following the instructions in https://abseil.io/docs/cpp/tools/cmake-installs. Then one only needs to do:
```
cmake <path/to/tink> \
-DCMAKE_CXX_STANDARD=11 \
-DCMAKE_PREFIX_PATH=<abseil/install/path> \
-DTINK_USE_INSTALLED_ABSEIL=ON
```
PiperOrigin-RevId: 424371062
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/TinkWorkspace.cmake | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cmake/TinkWorkspace.cmake b/cmake/TinkWorkspace.cmake index 04a3a5729..e3256317e 100644 --- a/cmake/TinkWorkspace.cmake +++ b/cmake/TinkWorkspace.cmake @@ -44,12 +44,18 @@ http_archive( SHA256 a7db7d1295ce46b93f3d1a90dbbc55a48409c00d19684fcd87823037add88118 ) -# Commit from 2021-12-03 -http_archive( - NAME com_google_absl - URL https://github.com/abseil/abseil-cpp/archive/9336be04a242237cd41a525bedfcf3be1bb55377.zip - SHA256 368be019fc8d69a566ac2cf7a75262d5ba8f6409e3ef3cdbcf0106bdeb32e91c -) +if (NOT TINK_USE_INSTALLED_ABSEIL) + # Commit from 2021-12-03 + http_archive( + NAME com_google_absl + URL https://github.com/abseil/abseil-cpp/archive/9336be04a242237cd41a525bedfcf3be1bb55377.zip + SHA256 368be019fc8d69a566ac2cf7a75262d5ba8f6409e3ef3cdbcf0106bdeb32e91c + ) +else() + # This is everything that needs to be done here. Abseil already defines its + # targets, which gets linked in tink_cc_(library|test). + find_package(absl REQUIRED) +endif() http_archive( NAME wycheproof |