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-08-30 02:21:10 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 43085d11f58f314d696276c8543561d411a4156aa546d1e14ed3d8adffded5818f1ad4259b3ad38bb5d4167bd9084f78c725eb53509999a2349a749b9eb47007
|
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
|
2023-08-30 02:21:10 +08:00
|
|
|
fix-windows.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
|
|
|
|
2023-08-30 02:21:10 +08:00
|
|
|
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()
|
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
|
|
|
|
2023-08-30 02:21:10 +08:00
|
|
|
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()
|