Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
liss-h authored Jul 29, 2024
2 parents 58e112a + 09618be commit b19d75b
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/detect-pobr-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Detect POBR diff

on: [ pull_request ]

concurrency:
group: detect-pobr-diff-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
detect-pobr-diff:
uses: dice-group/cpp-conan-release-reusable-workflow/.github/workflows/abi-diff.yml@main
with:
os: ubuntu-22.04
compiler: clang-16
cmake-version: 3.24.0
conan-version: 2.3.1
base-branch: ${{ github.base_ref }}
search-path: >
include/dice/hash/internal
abi-version-header: include/dice/hash/version.hpp
abi-version-const: dice::hash::pobr_version
secrets:
CONAN_USER: ""
CONAN_PW: ""
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,4 @@ modules.xml

test_package/build
conan_provider.cmake
include/dice/hash/version.hpp
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ cmake_minimum_required(VERSION 3.24)

project(
dice-hash
VERSION 0.4.5
VERSION 0.4.6
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

# 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
Expand All @@ -24,6 +25,14 @@ else()
MESSAGE(WARNING "Could not verify that your compiler (${CMAKE_CXX_COMPILER}) supports all needed features.")
endif()

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To use it with [conan](https://conan.io/) you need to add the repository:
conan remote add dice-group https://conan.dice-research.org/artifactory/api/conan/tentris
```

To use it add `dice-hash/0.4.5` to the `[requires]` section of your conan file.
To use it add `dice-hash/0.4.6` to the `[requires]` section of your conan file.

You can now add it to your target with:
```cmake
Expand Down
13 changes: 13 additions & 0 deletions cmake/version.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef DICE_HASH_VERSION_HPP
#define DICE_HASH_VERSION_HPP

#include <array>

namespace dice::hash {
inline constexpr char name[] = "@PROJECT_NAME@";
inline constexpr char version[] = "@PROJECT_VERSION@";
inline constexpr std::array<int, 3> version_tuple = {@PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@};
inline constexpr int pobr_version = @POBR_VERSION@; ///< persisted object binary representation version
} // namespace dice::hash

#endif // DICE_HASH_VERSION_HPP
9 changes: 8 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ class DiceHashConan(ConanFile):
exports = "LICENSE"
exports_sources = "include/*", "CMakeLists.txt", "cmake/*", "LICENSE"
no_copy_source = True
options = {
"with_test_deps": [True, False],
}
default_options = {
"with_test_deps": False,
}

# No settings/options are necessary, this is header only

Expand All @@ -34,7 +40,8 @@ def set_version(self):
self.description = re.search(r"project\([^)]*DESCRIPTION\s+\"([^\"]+)\"[^)]*\)", cmake_file).group(1)

def requirements(self):
self.test_requires("catch2/2.13.9")
if self.options.with_test_deps:
self.test_requires("catch2/2.13.9")

def layout(self):
cmake_layout(self)
Expand Down
3 changes: 2 additions & 1 deletion include/dice/hash.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#ifndef DICE_HASH_HASH_HPP
#define DICE_HASH_HASH_HPP
#include "dice/hash/DiceHash.hpp"
#include <dice/hash/DiceHash.hpp>
#include <dice/hash/version.hpp>
#endif//DICE_HASH_HASH_HPP

0 comments on commit b19d75b

Please sign in to comment.