2023-01-09 17:24:11 +08:00
|
|
|
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
|
2022-06-04 10:51:49 +08:00
|
|
|
|
2024-04-05 01:56:30 +08:00
|
|
|
set(DIRECTX_DXC_TAG v1.8.2403.2)
|
|
|
|
set(DIRECTX_DXC_VERSION 2024_03_29)
|
2023-03-07 07:24:41 +08:00
|
|
|
|
2023-01-09 17:24:11 +08:00
|
|
|
if (NOT VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
message(STATUS "Note: ${PORT} always requires dynamic library linkage at runtime.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (VCPKG_TARGET_IS_LINUX)
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-03-07 07:24:41 +08:00
|
|
|
URLS "https://github.com/microsoft/DirectXShaderCompiler/releases/download/${DIRECTX_DXC_TAG}/linux_dxc_${DIRECTX_DXC_VERSION}.x86_64.tar.gz"
|
|
|
|
FILENAME "linux_dxc_${DIRECTX_DXC_VERSION}.tar.gz"
|
2024-04-05 01:56:30 +08:00
|
|
|
SHA512 5d62ad6e05ffbffdd46e45ad4cf1aa0cd16ab240798a00a4f9e46ec51a4cdff2aeb19cca8167a20ce384b42a6a6ec34e3fde1a75cc08b5f0ff2dac42edda826b
|
2023-01-09 17:24:11 +08:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-03-07 07:24:41 +08:00
|
|
|
URLS "https://github.com/microsoft/DirectXShaderCompiler/releases/download/${DIRECTX_DXC_TAG}/dxc_${DIRECTX_DXC_VERSION}.zip"
|
|
|
|
FILENAME "dxc_${DIRECTX_DXC_VERSION}.zip"
|
2024-04-05 01:56:30 +08:00
|
|
|
SHA512 d8d33aaf9d1399d63237965567d179236edf6b4a003270ecd03fc5e31710995a68df74357a3059eafe03bd8b9e4fcaa5b540adb53e7360db455016164cfac052
|
2023-01-09 17:24:11 +08:00
|
|
|
)
|
|
|
|
endif()
|
2022-06-04 10:51:49 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(
|
|
|
|
LICENSE_TXT
|
2023-03-07 07:24:41 +08:00
|
|
|
URLS "https://raw.githubusercontent.com/microsoft/DirectXShaderCompiler/${DIRECTX_DXC_TAG}/LICENSE.TXT"
|
|
|
|
FILENAME "LICENSE.${DIRECTX_DXC_VERSION}"
|
2024-03-12 11:33:50 +08:00
|
|
|
SHA512 9feaa85ca6d42d5a2d6fe773706bbab8241e78390a9d61ea9061c8f0eeb5a3e380ff07c222e02fbf61af7f2b2f6dd31c5fc87247a94dae275dc0a20cdfcc8c9d
|
2022-06-04 10:51:49 +08:00
|
|
|
)
|
|
|
|
|
2023-01-09 17:24:11 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
PACKAGE_PATH
|
2022-06-04 10:51:49 +08:00
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
NO_REMOVE_ONE_LEVEL
|
|
|
|
)
|
|
|
|
|
2023-01-09 17:24:11 +08:00
|
|
|
if (VCPKG_TARGET_IS_LINUX)
|
2023-03-07 07:24:41 +08:00
|
|
|
file(INSTALL
|
|
|
|
"${PACKAGE_PATH}/include/dxc/dxcapi.h"
|
|
|
|
"${PACKAGE_PATH}/include/dxc/dxcerrors.h"
|
|
|
|
"${PACKAGE_PATH}/include/dxc/dxcisense.h"
|
|
|
|
"${PACKAGE_PATH}/include/dxc/WinAdapter.h"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}")
|
2022-06-04 10:51:49 +08:00
|
|
|
|
2023-01-09 17:24:11 +08:00
|
|
|
file(INSTALL
|
2023-03-07 07:24:41 +08:00
|
|
|
"${PACKAGE_PATH}/lib/libdxcompiler.so"
|
|
|
|
"${PACKAGE_PATH}/lib/libdxil.so"
|
2023-01-09 17:24:11 +08:00
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
2024-03-21 04:47:48 +08:00
|
|
|
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
|
|
|
file(INSTALL
|
|
|
|
"${PACKAGE_PATH}/lib/libdxcompiler.so"
|
|
|
|
"${PACKAGE_PATH}/lib/libdxil.so"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
|
|
endif()
|
2022-06-04 10:51:49 +08:00
|
|
|
|
2023-01-09 17:24:11 +08:00
|
|
|
file(INSTALL
|
2023-03-07 07:24:41 +08:00
|
|
|
"${PACKAGE_PATH}/bin/dxc"
|
2024-03-21 04:47:48 +08:00
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/")
|
2022-06-04 10:51:49 +08:00
|
|
|
|
2023-08-12 00:44:46 +08:00
|
|
|
set(dll_name_dxc "libdxcompiler.so")
|
|
|
|
set(dll_name_dxil "libdxil.so")
|
2023-01-09 17:24:11 +08:00
|
|
|
set(dll_dir "lib")
|
|
|
|
set(lib_name "libdxcompiler.so")
|
2024-03-21 04:47:48 +08:00
|
|
|
set(tool_path "tools/${PORT}/dxc")
|
2023-01-09 17:24:11 +08:00
|
|
|
else()
|
|
|
|
# VCPKG_TARGET_IS_WINDOWS
|
2023-03-07 07:24:41 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
|
|
|
set(DXC_ARCH arm64)
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
|
|
|
set(DXC_ARCH x86)
|
|
|
|
else()
|
|
|
|
set(DXC_ARCH x64)
|
|
|
|
endif()
|
2023-01-09 17:24:11 +08:00
|
|
|
|
2023-03-07 07:24:41 +08:00
|
|
|
file(INSTALL
|
|
|
|
"${PACKAGE_PATH}/inc/dxcapi.h"
|
|
|
|
"${PACKAGE_PATH}/inc/dxcerrors.h"
|
|
|
|
"${PACKAGE_PATH}/inc/dxcisense.h"
|
|
|
|
"${PACKAGE_PATH}/inc/d3d12shader.h"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}")
|
2023-01-09 17:24:11 +08:00
|
|
|
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
2024-03-21 04:47:48 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
|
|
endif()
|
2023-01-09 17:24:11 +08:00
|
|
|
|
|
|
|
file(INSTALL
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
2024-03-21 04:47:48 +08:00
|
|
|
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
|
|
|
file(INSTALL
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
2023-01-09 17:24:11 +08:00
|
|
|
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/")
|
|
|
|
|
|
|
|
file(INSTALL
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxc.exe"
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/")
|
|
|
|
|
2023-08-12 00:44:46 +08:00
|
|
|
set(dll_name_dxc "dxcompiler.dll")
|
|
|
|
set(dll_name_dxil "dxil.dll")
|
2023-01-09 17:24:11 +08:00
|
|
|
set(dll_dir "bin")
|
|
|
|
set(lib_name "dxcompiler.lib")
|
2024-03-21 04:47:48 +08:00
|
|
|
set(tool_path "tools/${PORT}/dxc.exe")
|
2023-01-09 17:24:11 +08:00
|
|
|
endif()
|
2022-06-04 10:51:49 +08:00
|
|
|
|
2024-03-21 04:47:48 +08:00
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
|
2023-01-09 17:24:11 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/directx-dxc-config.cmake.in"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake"
|
|
|
|
@ONLY)
|
2024-03-12 11:33:50 +08:00
|
|
|
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${LICENSE_TXT}")
|