2023-01-09 01:24:11 -08:00
|
|
|
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
|
2022-06-03 19:51:49 -07:00
|
|
|
|
2023-09-07 13:10:01 -07:00
|
|
|
set(DIRECTX_DXC_TAG v1.7.2308)
|
|
|
|
set(DIRECTX_DXC_VERSION 2023_08_14)
|
2023-03-06 15:24:41 -08:00
|
|
|
|
2023-01-09 01: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-06 15: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"
|
2023-09-07 13:10:01 -07:00
|
|
|
SHA512 7f1fb252b27fb00b9ffeadafb47921757c5e4d7df806283fe7629b866d2873896d7a7d599032aa2389f047d9791a447aabb22e3e8e7e1f3f76142675d831b738
|
2023-01-09 01:24:11 -08:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-03-06 15: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"
|
2023-09-07 13:10:01 -07:00
|
|
|
SHA512 3bc49f77b55f58de88002a75b38e5acdb8600b0b73729320a25a27af08f1f21d0b4aec92ee9d736eb30bae42f4e0f2f32d25d6635fa71aedcaf82440e6d2433e
|
2023-01-09 01:24:11 -08:00
|
|
|
)
|
|
|
|
endif()
|
2022-06-03 19:51:49 -07:00
|
|
|
|
|
|
|
vcpkg_download_distfile(
|
|
|
|
LICENSE_TXT
|
2023-03-06 15:24:41 -08:00
|
|
|
URLS "https://raw.githubusercontent.com/microsoft/DirectXShaderCompiler/${DIRECTX_DXC_TAG}/LICENSE.TXT"
|
|
|
|
FILENAME "LICENSE.${DIRECTX_DXC_VERSION}"
|
2022-06-03 19:51:49 -07:00
|
|
|
SHA512 7589f152ebc3296dca1c73609a2a23a911b8fc0029731268a6151710014d82005a868c85c8249219f060f64ab1ddecdddff5ed6ea34ff509f63ea3e42bbbf47e
|
|
|
|
)
|
|
|
|
|
2023-01-09 01:24:11 -08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
PACKAGE_PATH
|
2022-06-03 19:51:49 -07:00
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
NO_REMOVE_ONE_LEVEL
|
|
|
|
)
|
|
|
|
|
2023-01-09 01:24:11 -08:00
|
|
|
if (VCPKG_TARGET_IS_LINUX)
|
2023-03-06 15: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-03 19:51:49 -07:00
|
|
|
|
2023-01-09 01:24:11 -08:00
|
|
|
file(INSTALL
|
2023-03-06 15:24:41 -08:00
|
|
|
"${PACKAGE_PATH}/lib/libdxcompiler.so"
|
|
|
|
"${PACKAGE_PATH}/lib/libdxil.so"
|
2023-01-09 01:24:11 -08:00
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
|
|
|
file(INSTALL
|
2023-03-06 15:24:41 -08:00
|
|
|
"${PACKAGE_PATH}/lib/libdxcompiler.so"
|
|
|
|
"${PACKAGE_PATH}/lib/libdxil.so"
|
2023-01-09 01:24:11 -08:00
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
2022-06-03 19:51:49 -07:00
|
|
|
|
2023-01-09 01:24:11 -08:00
|
|
|
file(INSTALL
|
2023-03-06 15:24:41 -08:00
|
|
|
"${PACKAGE_PATH}/bin/dxc"
|
2023-01-09 01:24:11 -08:00
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
2022-06-03 19:51:49 -07:00
|
|
|
|
2023-08-11 18:44:46 +02:00
|
|
|
set(dll_name_dxc "libdxcompiler.so")
|
|
|
|
set(dll_name_dxil "libdxil.so")
|
2023-01-09 01:24:11 -08:00
|
|
|
set(dll_dir "lib")
|
|
|
|
set(lib_name "libdxcompiler.so")
|
|
|
|
set(tool_path "bin/dxc")
|
|
|
|
else()
|
|
|
|
# VCPKG_TARGET_IS_WINDOWS
|
2023-03-06 15: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 01:24:11 -08:00
|
|
|
|
2023-03-06 15: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 01:24:11 -08:00
|
|
|
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
|
|
|
|
|
|
file(INSTALL
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
file(INSTALL
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
|
|
|
|
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
|
|
|
|
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-11 18:44:46 +02:00
|
|
|
set(dll_name_dxc "dxcompiler.dll")
|
|
|
|
set(dll_name_dxil "dxil.dll")
|
2023-01-09 01:24:11 -08:00
|
|
|
set(dll_dir "bin")
|
|
|
|
set(lib_name "dxcompiler.lib")
|
|
|
|
set(tool_path "tools/directx-dxc/dxc.exe")
|
|
|
|
endif()
|
2022-06-03 19:51:49 -07:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
|
|
|
|
file(INSTALL "${LICENSE_TXT}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
|
|
|
|
2023-01-09 01:24:11 -08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/directx-dxc-config.cmake.in"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake"
|
|
|
|
@ONLY)
|