2019-09-30 07:20:51 +08:00
|
|
|
# On Windows, we can get a cpuinfo.dll, but it exports no symbols.
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO pytorch/cpuinfo
|
2021-05-06 04:37:53 +08:00
|
|
|
REF 5916273f79a21551890fd3d56fc5375a78d1598d
|
|
|
|
SHA512 50e537b61d991e8579577fb1ecf8d9ceb2171dbad96dfe159a062eadfdc0b2372b94988fc6f223c20e327453c7f55042ee06779f5b5fe0922f4470f746c9686b
|
2019-09-30 07:20:51 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2021-05-06 04:37:53 +08:00
|
|
|
fix-install.patch
|
2019-09-30 07:20:51 +08:00
|
|
|
)
|
|
|
|
|
2021-05-06 04:37:53 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
tools CPUINFO_BUILD_TOOLS
|
2019-09-30 07:20:51 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DCPUINFO_BUILD_TOOLS=OFF
|
2021-05-06 04:37:53 +08:00
|
|
|
-DCPUINFO_LOG_LEVEL=debug
|
2019-09-30 07:20:51 +08:00
|
|
|
OPTIONS_RELEASE
|
|
|
|
${FEATURE_OPTIONS}
|
2021-05-06 04:37:53 +08:00
|
|
|
-DCPUINFO_LOG_LEVEL=default
|
2019-09-30 07:20:51 +08:00
|
|
|
OPTIONS
|
|
|
|
-DCPUINFO_BUILD_UNIT_TESTS=OFF
|
|
|
|
-DCPUINFO_BUILD_MOCK_TESTS=OFF
|
|
|
|
-DCPUINFO_BUILD_BENCHMARKS=OFF
|
|
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_copy_pdbs()
|
2021-05-06 04:37:53 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT})
|
2019-09-30 07:20:51 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
2021-05-06 04:37:53 +08:00
|
|
|
if("tools" IN_LIST FEATURES)
|
2020-05-02 06:28:55 +08:00
|
|
|
vcpkg_copy_tools(
|
|
|
|
TOOL_NAMES cache-info cpuid-dump cpu-info isa-info
|
|
|
|
AUTO_CLEAN
|
|
|
|
)
|
2019-09-30 07:20:51 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Handle copyright
|
|
|
|
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
|