Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
liss-h authored Nov 18, 2024
2 parents 2e0337e + 08fb1a4 commit 9864210
Show file tree
Hide file tree
Showing 48 changed files with 6,575 additions and 775 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/add_conan_provider@main

- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -DBUILD_EXAMPLES=On -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -G Ninja -B build .
run: cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -DWITH_SODIUM=On -DBUILD_EXAMPLES=On -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -G Ninja -B build .
env:
CC: ${{ steps.install_cc.outputs.cc }}
CXX: ${{ steps.install_cc.outputs.cxx }}
Expand All @@ -74,7 +74,7 @@ jobs:

- name: Run tests
working-directory: build
run: ctest --verbose -j2
run: ctest --verbose -j2 -E ".*Benchmark.*"

- name: Run examples
working-directory: build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/detect-pobr-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
base-branch: ${{ github.base_ref }}
search-path: >
include/dice/hash/internal
include/dice/hash/blake
include/dice/hash/lthash
abi-version-header: include/dice/hash/version.hpp
abi-version-const: dice::hash::pobr_version
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
public_artifactory: true
os: ubuntu-22.04
compiler: clang-14
compiler: clang-17
cmake-version: 3.24.0
conan-version: 2.3.0
secrets:
Expand Down
57 changes: 49 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ cmake_minimum_required(VERSION 3.24)

project(
dice-hash
VERSION 0.4.8
VERSION 0.4.9
DESCRIPTION "dice-hash provides a framework to generate stable hashes. It provides state-of-the-art hash functions, supports STL containers out of the box and helps you to defines stable hashes for your own structs and classes."
HOMEPAGE_URL "https://dice-group.github.io/dice-hash/")
set(POBR_VERSION 1) # Persisted Object Binary Representation Version

include(cmake/boilerplate_init.cmake)
boilerplate_init()

# set gcc-10 and clang-10 as minimum versions see
# https://stackoverflow.com/questions/14933172/how-can-i-add-a-minimum-compiler-version-requisite#14934542
set(MIN_COMPILER_VERSION_GCC "10.0.0")
Expand All @@ -27,21 +30,59 @@ endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/include/dice/hash/version.hpp)

OPTION(WITH_SODIUM "Enable usage of the external library sodium for Blake2b, Blake2Xb and LtHash support" OFF)

if (PROJECT_IS_TOP_LEVEL)
if (BUILD_TESTING)
set(CONAN_INSTALL_ARGS "${CONAN_INSTALL_ARGS};-o=&:with_test_deps=True")
endif ()
if (WITH_SODIUM)
set(CONAN_INSTALL_ARGS "${CONAN_INSTALL_ARGS};-o=&:with_sodium=True")
endif ()
endif ()

add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
if (WITH_SODIUM)
find_package(libsodium REQUIRED)
find_package(highway REQUIRED)
endif ()

add_subdirectory(include/dice/hash/blake/internal/blake3)

target_include_directories(
${PROJECT_NAME}
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
if (WITH_SODIUM)
add_library(${PROJECT_NAME}
include/dice/hash/lthash/MathEngine_Hwy.cpp
)

target_include_directories(
${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_link_libraries(${PROJECT_NAME}
PUBLIC
libsodium::libsodium
blake3
PRIVATE
highway::highway
)
else()
add_library(${PROJECT_NAME} INTERFACE)

target_include_directories(
${PROJECT_NAME}
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_link_libraries(${PROJECT_NAME}
INTERFACE
blake3
)
endif()

add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

include(cmake/install_interface_library.cmake)
install_interface_library(${PROJECT_NAME} "include")
include(cmake/install_library.cmake)
install_cpp_library(${PROJECT_NAME} "include")

if(PROJECT_IS_TOP_LEVEL AND BUILD_TESTING)
include(CTest)
Expand Down
Loading

0 comments on commit 9864210

Please sign in to comment.