aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/cpu-features
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/cpu-features
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/cpu-features')
-rw-r--r--vcpkg/ports/cpu-features/portfile.cmake43
-rw-r--r--vcpkg/ports/cpu-features/usage4
-rw-r--r--vcpkg/ports/cpu-features/usage_android7
-rw-r--r--vcpkg/ports/cpu-features/vcpkg.json23
4 files changed, 77 insertions, 0 deletions
diff --git a/vcpkg/ports/cpu-features/portfile.cmake b/vcpkg/ports/cpu-features/portfile.cmake
new file mode 100644
index 0000000..2d9dfb5
--- /dev/null
+++ b/vcpkg/ports/cpu-features/portfile.cmake
@@ -0,0 +1,43 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO google/cpu_features
+ REF "v${VERSION}"
+ SHA512 40c314c584fcf109d9a641c055cb75f335fd5425dd336fe831828b956226eaf0ac2fd8ffceeaf10e02afa9cec01cb0ddc6af8ff78f20dd925783e6958d0b9304
+ HEAD_REF master
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ tools BUILD_EXECUTABLE
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DBUILD_TESTING=OFF
+)
+
+vcpkg_cmake_install()
+
+if(VCPKG_TARGET_IS_ANDROID)
+ vcpkg_cmake_config_fixup(PACKAGE_NAME "CpuFeatures" CONFIG_PATH "lib/cmake/CpuFeatures" DO_NOT_DELETE_PARENT_CONFIG_PATH)
+ vcpkg_cmake_config_fixup(PACKAGE_NAME "CpuFeaturesNdkCompat" CONFIG_PATH "lib/cmake/CpuFeaturesNdkCompat")
+else()
+ vcpkg_cmake_config_fixup(PACKAGE_NAME "CpuFeatures" CONFIG_PATH "lib/cmake/CpuFeatures")
+endif()
+
+if("tools" IN_LIST FEATURES)
+ vcpkg_copy_tools(TOOL_NAMES "list_cpu_features" AUTO_CLEAN)
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+if(VCPKG_TARGET_IS_ANDROID)
+ file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage_android" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "usage")
+else()
+ file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+endif()
diff --git a/vcpkg/ports/cpu-features/usage b/vcpkg/ports/cpu-features/usage
new file mode 100644
index 0000000..c9c863a
--- /dev/null
+++ b/vcpkg/ports/cpu-features/usage
@@ -0,0 +1,4 @@
+cpu-features provides CMake targets:
+
+ find_package(CpuFeatures CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE CpuFeatures::cpu_features)
diff --git a/vcpkg/ports/cpu-features/usage_android b/vcpkg/ports/cpu-features/usage_android
new file mode 100644
index 0000000..8fa0d51
--- /dev/null
+++ b/vcpkg/ports/cpu-features/usage_android
@@ -0,0 +1,7 @@
+cpu-features provides CMake targets:
+
+ find_package(CpuFeatures CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE CpuFeatures::cpu_features)
+
+ find_package(CpuFeaturesNdkCompat CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE CpuFeatures::ndk_compat)
diff --git a/vcpkg/ports/cpu-features/vcpkg.json b/vcpkg/ports/cpu-features/vcpkg.json
new file mode 100644
index 0000000..f56eb97
--- /dev/null
+++ b/vcpkg/ports/cpu-features/vcpkg.json
@@ -0,0 +1,23 @@
+{
+ "name": "cpu-features",
+ "version": "0.10.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": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "tools": {
+ "description": "list_cpu_features command line tool"
+ }
+ }
+}