aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/crc32c
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/crc32c')
-rw-r--r--vcpkg/ports/crc32c/fix_clang-cl.patch13
-rw-r--r--vcpkg/ports/crc32c/portfile.cmake33
-rw-r--r--vcpkg/ports/crc32c/vcpkg.json18
3 files changed, 64 insertions, 0 deletions
diff --git a/vcpkg/ports/crc32c/fix_clang-cl.patch b/vcpkg/ports/crc32c/fix_clang-cl.patch
new file mode 100644
index 0000000..d120243
--- /dev/null
+++ b/vcpkg/ports/crc32c/fix_clang-cl.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 84907285c..8c446b0c8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -22,7 +22,7 @@ if(NOT CMAKE_CXX_STANDARD)
+ endif(NOT CMAKE_CXX_STANDARD)
+
+ # https://github.com/izenecloud/cmake/blob/master/SetCompilerWarningAll.cmake
+-if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
++if(MSVC)
+ # Use the highest warning level for Visual Studio.
+ set(CMAKE_CXX_WARNING_LEVEL 4)
+ if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
diff --git a/vcpkg/ports/crc32c/portfile.cmake b/vcpkg/ports/crc32c/portfile.cmake
new file mode 100644
index 0000000..0280002
--- /dev/null
+++ b/vcpkg/ports/crc32c/portfile.cmake
@@ -0,0 +1,33 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO google/crc32c
+ REF 1.1.2
+ SHA512 6325c52b5a6850b9f90086e0c0c86798c008af36e7cfd3a0216184a2d37b3bf7323481ddc6bfe4cbd5b31288b3ee6c69772d03085a13094cf95d00a9756a7196
+ HEAD_REF master
+ PATCHES
+ fix_clang-cl.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ -DCRC32C_BUILD_TESTS=OFF
+ -DCRC32C_BUILD_BENCHMARKS=OFF
+ -DCRC32C_USE_GLOG=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Crc32c)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+endif()
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/vcpkg/ports/crc32c/vcpkg.json b/vcpkg/ports/crc32c/vcpkg.json
new file mode 100644
index 0000000..3f8718a
--- /dev/null
+++ b/vcpkg/ports/crc32c/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "crc32c",
+ "version": "1.1.2",
+ "port-version": 2,
+ "description": "CRC32C implementation with support for CPU-specific acceleration instructions.",
+ "homepage": "https://github.com/google/crc32c",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}