early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,98 @@
Fixes includes of endian.h on MacOS, see https://github.com/stbrumme/hash-library/pull/4.
diff --git a/crc32.cpp b/crc32.cpp
--- a/crc32.cpp
+++ b/crc32.cpp
@@ -7,8 +7,10 @@
#include "crc32.h"
// big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+ #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+ #include <endian.h>
#endif
diff --git a/keccak.cpp b/keccak.cpp
--- a/keccak.cpp
+++ b/keccak.cpp
@@ -7,8 +7,10 @@
#include "keccak.h"
// big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+ #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+ #include <endian.h>
#endif
diff --git a/md5.cpp b/md5.cpp
--- a/md5.cpp
+++ b/md5.cpp
@@ -6,8 +6,10 @@
#include "md5.h"
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+ #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+ #include <endian.h>
#endif
diff --git a/sha1.cpp b/sha1.cpp
--- a/sha1.cpp
+++ b/sha1.cpp
@@ -7,8 +7,10 @@
#include "sha1.h"
// big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+ #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+ #include <endian.h>
#endif
diff --git a/sha256.cpp b/sha256.cpp
--- a/sha256.cpp
+++ b/sha256.cpp
@@ -7,8 +7,10 @@
#include "sha256.h"
// big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+ #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+ #include <endian.h>
#endif
diff --git a/sha3.cpp b/sha3.cpp
--- a/sha3.cpp
+++ b/sha3.cpp
@@ -7,8 +7,10 @@
#include "sha3.h"
// big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+ #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+ #include <endian.h>
#endif
#include <iostream>

View File

@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 3.5.1)
project(hash-library CXX)
set(HEADERS
crc32.h
hash.h
hmac.h
keccak.h
md5.h
sha1.h
sha256.h
sha3.h
)
set(SRCS
crc32.cpp
keccak.cpp
md5.cpp
sha1.cpp
sha256.cpp
sha3.cpp
)
add_library(hash-library ${SRCS})
target_include_directories(hash-library PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/hash-library>)
if(NOT DISABLE_INSTALL_HEADERS)
install(FILES ${HEADERS} DESTINATION include/hash-library)
endif()
install(
TARGETS hash-library
EXPORT unofficial-hash-library-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(
EXPORT unofficial-hash-library-targets
FILE unofficial-hash-library-targets.cmake
NAMESPACE unofficial::
DESTINATION share/unofficial-hash-library
)

View File

@@ -0,0 +1,26 @@
if(WIN32)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO stbrumme/hash-library
REF hash_library_v8
SHA512 1c428710c0c3e4d5d1114d757a5d9145ed12c7e2fbbfa51635f43a349ddb5634bdf49e8d8fdbc7576e90b319989fb85efec433bb43ddb551c2cf29a8e80ba78b
HEAD_REF master
PATCHES
001-fix-macos.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME "unofficial-${PORT}" CONFIG_PATH "share/unofficial-${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

18
externals/vcpkg/ports/hash-library/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,18 @@
{
"name": "hash-library",
"version": "8",
"port-version": 1,
"description": "Portable C++ hashing library",
"homepage": "https://create.stephan-brumme.com/hash-library/",
"license": "Zlib",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}