2020-09-01 07:17:32 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/cpu_features
|
2023-01-31 09:15:14 +08:00
|
|
|
REF v0.7.0
|
|
|
|
SHA512 e602c88c4a104d69dff0297a4c4f8e26d02d548fc35ce2616429ff8280f2a37e9eaa99451a38b7c302907352cf15bdf8c09c2e0e52b09bf4cd3b7e2b21f8ddb0
|
2020-09-01 07:17:32 +08:00
|
|
|
HEAD_REF master
|
2022-04-30 02:40:30 +08:00
|
|
|
PATCHES
|
|
|
|
make_list_cpu_features_optional.patch
|
|
|
|
windows-x86-fix.patch
|
2020-09-01 07:17:32 +08:00
|
|
|
)
|
|
|
|
|
2021-06-02 03:17:00 +08:00
|
|
|
# If feature "tools" is not specified, disable building/exporting executable targets.
|
|
|
|
# This is necessary so that downstream find_package(CpuFeatures) does not fail.
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
tools BUILD_EXECUTABLE
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
2020-09-01 07:17:32 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS
|
2021-06-02 03:17:00 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2023-01-31 09:15:14 +08:00
|
|
|
-DBUILD_TESTING=OFF
|
2020-09-01 07:17:32 +08:00
|
|
|
)
|
|
|
|
|
2021-06-02 03:17:00 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-09-01 07:17:32 +08:00
|
|
|
|
2021-06-02 03:17:00 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME "CpuFeatures" CONFIG_PATH "lib/cmake/CpuFeatures")
|
2020-09-01 07:17:32 +08:00
|
|
|
|
|
|
|
if("tools" IN_LIST FEATURES)
|
2021-06-02 03:17:00 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES "list_cpu_features" AUTO_CLEAN)
|
2020-09-01 07:17:32 +08:00
|
|
|
endif()
|
|
|
|
|
2021-06-02 03:17:00 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2020-09-01 07:17:32 +08:00
|
|
|
|
2021-06-02 03:17:00 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|