vcpkg/ports/onednn/portfile.cmake

29 lines
932 B
CMake
Raw Normal View History

vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "uwp")
2020-12-17 16:12:26 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO oneapi-src/oneDNN
REF v2.3.2
SHA512 14B3E6E40F29250AAE1FC677E6723953CA3BFBC9544B32CA1AE51ABA35DAB53C8CFCC58DD57610E644EB324821F3F370A31E8D960B1E4D5AF0C066441ED7FF45
2020-12-17 16:12:26 +08:00
HEAD_REF master
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(DNNL_OPTIONS "-DDNNL_LIBRARY_TYPE=STATIC")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
2020-12-17 16:12:26 +08:00
OPTIONS ${DNNL_OPTIONS}
)
vcpkg_cmake_install()
2020-12-17 16:12:26 +08:00
# The port name and the find_package() name are different (onednn versus dnnl)
vcpkg_cmake_config_fixup(PACKAGE_NAME dnnl CONFIG_PATH lib/cmake/dnnl)
2020-12-17 16:12:26 +08:00
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Copyright and license
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)