2021-03-20 01:03:17 +08:00
|
|
|
# The project's CMakeLists.txt uses Python to select source files. Check if it is available in advance.
|
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO pytorch/fbgemm
|
2023-04-11 10:27:41 +08:00
|
|
|
REF 64833b5185893cbc71ea80c9b01443f762b5cba4
|
|
|
|
SHA512 f256177f22d3a4abd9c861bafd96e12df33e7604416c26ac06c9e480fd5f1e0b4149132b3216790704ebf73d47a7277235f058d58f0ecafa8de23360022f202d
|
2021-03-20 01:03:17 +08:00
|
|
|
PATCHES
|
|
|
|
fix-cmakelists.patch
|
|
|
|
)
|
|
|
|
|
2021-09-14 11:04:23 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-03-20 01:03:17 +08:00
|
|
|
OPTIONS
|
|
|
|
-DUSE_SANITIZER=OFF
|
|
|
|
-DFBGEMM_BUILD_TESTS=OFF
|
|
|
|
-DFBGEMM_BUILD_BENCHMARKS=OFF
|
|
|
|
-DPYTHON_EXECUTABLE=${PYTHON3} # inject the path instead of find_package(Python)
|
|
|
|
)
|
2021-09-14 11:04:23 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-03-20 01:03:17 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-09-14 11:04:23 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME fbgemmLibrary CONFIG_PATH share/cmake/${PORT})
|
2021-03-20 01:03:17 +08:00
|
|
|
|
2021-09-14 11:04:23 +08:00
|
|
|
# this internal header is required by pytorch
|
|
|
|
file(INSTALL "${SOURCE_PATH}/src/RefImplementations.h"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/include/fbgemm/src")
|
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "copyright")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|