Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Add ethash package #1430

Merged
merged 2 commits into from
May 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ hunter_config(CsvParserCPlusPlus VERSION 1.0.1)
hunter_config(Eigen VERSION 3.3.4-p1)
hunter_config(state_machine VERSION 1.1)
hunter_config(enet VERSION 1.3.13-p1)
hunter_config(ethash VERSION 0.1.0)
hunter_config(Expat VERSION 2.1.1)
if(MSVC)
hunter_config(getopt VERSION 1.0.0-p0)
Expand Down
30 changes: 30 additions & 0 deletions cmake/projects/ethash/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2018, Pawel Bylica

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
PACKAGE_NAME
ethash
VERSION
0.1.0
URL
https://github.com/chfast/ethash/archive/v0.1.0.tar.gz
SHA1
bc97f901164e04a53c67b536cc9b58fae6ed9bb5
)

hunter_cmake_args(
ethash
CMAKE_ARGS
ETHASH_BUILD_TESTS=OFF
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(ethash)
hunter_download(PACKAGE_NAME ethash)
2 changes: 1 addition & 1 deletion docs/packages/pkg/Snappy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Snappy

.. index:: unsorted ; Snappy
.. index:: compression ; Snappy

.. _pkg.Snappy:

Expand Down
19 changes: 19 additions & 0 deletions docs/packages/pkg/ethash.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. spelling::

ethash

.. index:: crypto ; ethash

.. _pkg.ethash:

ethash
======

- `Official <https://github.com/chfast/ethash>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/ethash/CMakeLists.txt>`__
- Added by `Paweł Bylica <https://github.com/chfast>`__ (`pr-1430 <https://github.com/ruslo/hunter/pull/1430>`__)

.. literalinclude:: /../examples/ethash/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
15 changes: 15 additions & 0 deletions examples/ethash/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.2)

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(use-ethash)

# DOCUMENTATION_START {
hunter_add_package(ethash)
find_package(ethash CONFIG REQUIRED)

add_executable(use_ethash main.cpp)
target_link_libraries(use_ethash ethash::ethash)
# DOCUMENTATION_END }
7 changes: 7 additions & 0 deletions examples/ethash/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <ethash/ethash.hpp>

int main()
{
ethash::calculate_light_cache_num_items(1);
return 0;
}