aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2020-09-01 07:17:32 +0800
committerGitHub <noreply@github.com>2020-08-31 16:17:32 -0700
commitb9da3975f738a23018a631387d95821b30bf3331 (patch)
tree10084eb3d5199c489d373b594d04feb7028f2f25
parent85a6327c70944d905dc4d73cb57eb707e4609187 (diff)
downloadvcpkg-b9da3975f738a23018a631387d95821b30bf3331.tar.gz
vcpkg-b9da3975f738a23018a631387d95821b30bf3331.zip
[cpu-features] Add new port (#12681)
-rw-r--r--ports/cpu-features/portfile.cmake30
-rw-r--r--ports/cpu-features/vcpkg.json14
2 files changed, 44 insertions, 0 deletions
diff --git a/ports/cpu-features/portfile.cmake b/ports/cpu-features/portfile.cmake
new file mode 100644
index 000000000..e50d5ef14
--- /dev/null
+++ b/ports/cpu-features/portfile.cmake
@@ -0,0 +1,30 @@
+vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO google/cpu_features
+ REF b9593c8b395318bb2bc42683a94f962564cc4664 # 0.4.1
+ SHA512 8c12b50741e2979a32b69c788934bee0d00811b7662006c8b493e98d5efeada67ed59460be40c234b2d3bafd85671cb1a1d7c1a6ee535a7fc1cc6ac56a754576
+ HEAD_REF master
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/CpuFeatures TARGET_PATH share/CpuFeatures)
+
+if("tools" IN_LIST FEATURES)
+ vcpkg_copy_tools(TOOL_NAMES list_cpu_features)
+endif()
+vcpkg_clean_executables_in_bin(FILE_NAMES list_cpu_features)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/cpu-features/vcpkg.json b/ports/cpu-features/vcpkg.json
new file mode 100644
index 000000000..f773cf60b
--- /dev/null
+++ b/ports/cpu-features/vcpkg.json
@@ -0,0 +1,14 @@
+{
+ "name": "cpu-features",
+ "version-string": "0.4.1",
+ "description": "A cross-platform C library to retrieve CPU features (such as available instructions) at runtime",
+ "homepage": "https://github.com/google/cpu_features",
+ "license": "Apache-2.0",
+ "supports": "!(arm | uwp)",
+ "features": [
+ {
+ "name": "tools",
+ "description": "list_cpu_features command line tool"
+ }
+ ]
+}