diff --git a/ports/dstorage/dstorage-config.cmake.in b/ports/dstorage/dstorage-config.cmake.in new file mode 100644 index 00000000000000..c295619517ddfc --- /dev/null +++ b/ports/dstorage/dstorage-config.cmake.in @@ -0,0 +1,25 @@ + +get_filename_component(_dstorage_root "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_dstorage_root "${_dstorage_root}" PATH) +get_filename_component(_dstorage_root "${_dstorage_root}" PATH) + +set(_dstorage_root_lib "${_dstorage_root}/lib/dstorage.lib") +if (EXISTS "${_dstorage_root_lib}") + + add_library(Microsoft::DirectStorage SHARED IMPORTED) + set_target_properties(Microsoft::DirectStorage PROPERTIES + IMPORTED_LOCATION "${_dstorage_root}/bin/dstorage.dll" + IMPORTED_IMPLIB "${_dstorage_root_lib}" + INTERFACE_INCLUDE_DIRECTORIES "${_dstorage_root}/include" + IMPORTED_LINK_INTERFACE_LANGUAGES "C") + + set(dstorage_FOUND TRUE) + +else() + + set(dstorage_FOUND FALSE) + +endif() + +unset(_dstorage_root_lib) +unset(_dstorage_root) diff --git a/ports/dstorage/portfile.cmake b/ports/dstorage/portfile.cmake new file mode 100644 index 00000000000000..45c04b469a75c5 --- /dev/null +++ b/ports/dstorage/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_download_distfile(ARCHIVE + URLS "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.DirectStorage/1.0.0" + FILENAME "directstorage.1.0.0.zip" + SHA512 34f24842d509ccddf2c8a06e94a2f67c0746ed8acb6d90ab89453ed4ec9b123970cf1e802375af27e6d5be3c82211813009f8f4b83f233ce419a1467b8c10846 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH PACKAGE_PATH + ARCHIVE ${ARCHIVE} + NO_REMOVE_ONE_LEVEL +) + +file(INSTALL "${PACKAGE_PATH}/Include/DirectStorage/dstorage.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") +file(INSTALL "${PACKAGE_PATH}/Include/DirectStorage/dstorageerr.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") + +file(INSTALL "${PACKAGE_PATH}/bin/${VCPKG_TARGET_ARCHITECTURE}/dstorage.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + +file(COPY "${PACKAGE_PATH}/bin/${VCPKG_TARGET_ARCHITECTURE}/dstorage.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") +file(COPY "${PACKAGE_PATH}/bin/${VCPKG_TARGET_ARCHITECTURE}/dstoragecore.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") + +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug") +file(COPY "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug") + +file(INSTALL "${PACKAGE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +configure_file("${CMAKE_CURRENT_LIST_DIR}/dstorage-config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake" COPYONLY) diff --git a/ports/dstorage/vcpkg.json b/ports/dstorage/vcpkg.json new file mode 100644 index 00000000000000..66ada05dfe7e28 --- /dev/null +++ b/ports/dstorage/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "dstorage", + "version": "1.0.0", + "description": "DirectStorage for Windows", + "homepage": "https://aka.ms/directstorage/", + "license": null, + "supports": "windows & !uwp & !static" +} diff --git a/versions/baseline.json b/versions/baseline.json index be5555c2427895..e76999ffe9b9c8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1944,6 +1944,10 @@ "baseline": "1.7.5", "port-version": 0 }, + "dstorage": { + "baseline": "1.0.0", + "port-version": 0 + }, "dtl": { "baseline": "1.19", "port-version": 1 diff --git a/versions/d-/dstorage.json b/versions/d-/dstorage.json new file mode 100644 index 00000000000000..cc27ca92254889 --- /dev/null +++ b/versions/d-/dstorage.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "b2494bc112c6d12ffbb8a8bc687a1ae2ad583221", + "version": "1.0.0", + "port-version": 0 + } + ] +}