Skip to content

Commit

Permalink
[cpu-features] Add new port (#12681)
Browse files Browse the repository at this point in the history
  • Loading branch information
myd7349 authored Aug 31, 2020
1 parent 85a6327 commit b9da397
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
30 changes: 30 additions & 0 deletions ports/cpu-features/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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)
14 changes: 14 additions & 0 deletions ports/cpu-features/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}

0 comments on commit b9da397

Please sign in to comment.