Skip to content

Commit 80b50ed

Browse files
author
Igor Egorov
authored
Add Rust installation check to BLS cmake (#82)
Signed-off-by: Igor Egorov <[email protected]>
1 parent 5874a36 commit 80b50ed

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ Filecoin is a decentralized protocol described in [spec](https://filecoin-projec
66

77
## Dependencies
88

9-
All dependencies are managed using [Hunter](hunter.sh). It uses cmake to download required libraries and do not require to download and install packages manually.
9+
All C++ dependencies are managed using [Hunter](hunter.sh).
10+
It uses cmake to download required libraries and do not require to download and install packages manually.
1011
Target C++ compilers are:
1112
* GCC 7.4
1213
* Clang 6.0.1
1314
* AppleClang 11.0
1415

16+
### Rust Installation
1517

18+
C++ Filecoin implementation uses Rust libraries as dependencies for BLS provider.
19+
All you need to build these targets successfully - is Rust lang installed to your `${HOME}/.cargo/bin`.
20+
21+
You can do it manually following the instructions from [rust-lang.org](https://www.rust-lang.org/tools/install) or any other way.
22+
23+
Otherwise, CMake would not be able to compile Rust-related targets and will produce a warning about that during configuration.
1624

1725
## Clone
1826

deps/bls-signatures.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
# SPDX-License-Identifier: Apache-2.0
44
#
55

6+
if(EXISTS "$ENV{HOME}/.cargo/bin/cargo")
7+
message(STATUS "Rust cargo is present")
8+
else()
9+
message(STATUS "No Rust cargo found")
10+
message(WARNING
11+
"Rust is required for building BLS dependencies.\n"
12+
"You can install rust-lang via the following command:\n"
13+
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
14+
)
15+
endif()
16+
617
set(BUILD_TYPE "release")
718

819
set(BLS_BUILD_PATH

0 commit comments

Comments
 (0)