aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/directx-dxc
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/directx-dxc
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/directx-dxc')
-rw-r--r--vcpkg/ports/directx-dxc/directx-dxc-config.cmake.in28
-rw-r--r--vcpkg/ports/directx-dxc/portfile.cmake132
-rw-r--r--vcpkg/ports/directx-dxc/usage6
-rw-r--r--vcpkg/ports/directx-dxc/vcpkg.json23
4 files changed, 189 insertions, 0 deletions
diff --git a/vcpkg/ports/directx-dxc/directx-dxc-config.cmake.in b/vcpkg/ports/directx-dxc/directx-dxc-config.cmake.in
new file mode 100644
index 0000000..ef7fc52
--- /dev/null
+++ b/vcpkg/ports/directx-dxc/directx-dxc-config.cmake.in
@@ -0,0 +1,28 @@
+get_filename_component(_dxc_root "${CMAKE_CURRENT_LIST_DIR}" PATH)
+get_filename_component(_dxc_root "${_dxc_root}" PATH)
+
+set(DIRECTX_DXC_TOOL "${_dxc_root}/@tool_path@" CACHE PATH "Location of the dxc tool")
+mark_as_advanced(DIRECTX_DXC_TOOL)
+
+add_library(Microsoft::DirectXShaderCompiler SHARED IMPORTED)
+set_target_properties(Microsoft::DirectXShaderCompiler PROPERTIES
+ IMPORTED_CONFIGURATIONS "Debug;Release"
+ IMPORTED_LOCATION_DEBUG "${_dxc_root}/@dll_debug_dir@/@dll_name_dxc@"
+ IMPORTED_LOCATION_RELEASE "${_dxc_root}/@dll_dir@/@dll_name_dxc@"
+ IMPORTED_IMPLIB "${_dxc_root}/lib/@lib_name@"
+ IMPORTED_SONAME "@lib_name@"
+ INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include/directx-dxc"
+ INTERFACE_LINK_LIBRARIES "Microsoft::DXIL"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C")
+
+add_library(Microsoft::DXIL SHARED IMPORTED)
+set_target_properties(Microsoft::DXIL PROPERTIES
+ IMPORTED_CONFIGURATIONS "Debug;Release"
+ IMPORTED_LOCATION_DEBUG "${_dxc_root}/@dll_debug_dir@/@dll_name_dxil@"
+ IMPORTED_LOCATION_RELASE "${_dxc_root}/@dll_dir@/@dll_name_dxil@"
+ IMPORTED_IMPLIB "${_dxc_root}/lib/@lib_name@"
+ IMPORTED_NO_SONAME TRUE
+ INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include/directx-dxc"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C")
+
+unset(_dxc_root)
diff --git a/vcpkg/ports/directx-dxc/portfile.cmake b/vcpkg/ports/directx-dxc/portfile.cmake
new file mode 100644
index 0000000..3541eb9
--- /dev/null
+++ b/vcpkg/ports/directx-dxc/portfile.cmake
@@ -0,0 +1,132 @@
+set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
+
+set(DIRECTX_DXC_TAG v1.8.2505.1)
+set(DIRECTX_DXC_VERSION 2025_07_14)
+
+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
+ 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"
+ SHA512 4c4138f6720396c71474f3eef96f0d0b510fb612d0183c3b77588c42433889cc0f07fd4549538e9746b4066a2c83de40a6bc9acb7f9bbcd97b7e4ce1a07031ef
+ )
+else()
+ vcpkg_download_distfile(ARCHIVE
+ URLS "https://github.com/microsoft/DirectXShaderCompiler/releases/download/${DIRECTX_DXC_TAG}/dxc_${DIRECTX_DXC_VERSION}.zip"
+ FILENAME "dxc_${DIRECTX_DXC_VERSION}.zip"
+ SHA512 69dd74ee2bc8a7ac569fa71351209412f74ef901c58dc59d413277e3129ce78d31dbca0996c2910048bfd0575e7a10655d89d361b5a2ed2963c831385711380f
+ )
+endif()
+
+vcpkg_download_distfile(
+ LICENSE_TXT
+ URLS "https://raw.githubusercontent.com/microsoft/DirectXShaderCompiler/${DIRECTX_DXC_TAG}/LICENSE.TXT"
+ FILENAME "LICENSE.${DIRECTX_DXC_VERSION}"
+ SHA512 9feaa85ca6d42d5a2d6fe773706bbab8241e78390a9d61ea9061c8f0eeb5a3e380ff07c222e02fbf61af7f2b2f6dd31c5fc87247a94dae275dc0a20cdfcc8c9d
+)
+
+vcpkg_extract_source_archive(
+ PACKAGE_PATH
+ ARCHIVE ${ARCHIVE}
+ NO_REMOVE_ONE_LEVEL
+)
+
+if (VCPKG_TARGET_IS_LINUX)
+ 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}")
+
+ file(INSTALL
+ "${PACKAGE_PATH}/lib/libdxcompiler.so"
+ "${PACKAGE_PATH}/lib/libdxil.so"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+
+ 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()
+
+ file(INSTALL
+ "${PACKAGE_PATH}/bin/dxc"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/"
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+
+ set(dll_name_dxc "libdxcompiler.so")
+ set(dll_name_dxil "libdxil.so")
+ set(dll_dir "lib")
+ if(NOT DEFINED VCPKG_BUILD_TYPE)
+ set(dll_debug_dir "debug/lib")
+ else()
+ set(dll_debug_dir "lib")
+ endif()
+ set(lib_name "libdxcompiler.so")
+ set(tool_path "tools/${PORT}/dxc")
+else()
+ # VCPKG_TARGET_IS_WINDOWS
+ 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()
+
+ 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}")
+
+ file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ if(NOT DEFINED VCPKG_BUILD_TYPE)
+ file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+ endif()
+
+ file(INSTALL
+ "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
+ "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
+
+ 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()
+
+ 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}/")
+
+ set(dll_name_dxc "dxcompiler.dll")
+ set(dll_name_dxil "dxil.dll")
+ set(dll_dir "bin")
+ set(dll_debug_dir "bin")
+ set(lib_name "dxcompiler.lib")
+ set(tool_path "tools/${PORT}/dxc.exe")
+endif()
+
+vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+
+configure_file("${CMAKE_CURRENT_LIST_DIR}/directx-dxc-config.cmake.in"
+ "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake"
+ @ONLY)
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${LICENSE_TXT}")
diff --git a/vcpkg/ports/directx-dxc/usage b/vcpkg/ports/directx-dxc/usage
new file mode 100644
index 0000000..2b919ee
--- /dev/null
+++ b/vcpkg/ports/directx-dxc/usage
@@ -0,0 +1,6 @@
+The DirectX Shader Compiler package provides CMake targets:
+
+ find_package(directx-dxc CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Microsoft::DirectXShaderCompiler)
+
+The CMake variable DIRECTX_DXC_TOOL is also set to point to the appropriate DXC command-line tool.
diff --git a/vcpkg/ports/directx-dxc/vcpkg.json b/vcpkg/ports/directx-dxc/vcpkg.json
new file mode 100644
index 0000000..1a4ca10
--- /dev/null
+++ b/vcpkg/ports/directx-dxc/vcpkg.json
@@ -0,0 +1,23 @@
+{
+ "name": "directx-dxc",
+ "version-date": "2025-10-10",
+ "description": "DirectX Shader Compiler (LLVM/Clang)",
+ "homepage": "https://github.com/microsoft/DirectXShaderCompiler",
+ "documentation": "https://github.com/microsoft/DirectXShaderCompiler/wiki",
+ "license": null,
+ "supports": "(windows & !arm32 & !uwp & !xbox) | (linux & x64)",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ {
+ "name": "zlib",
+ "platform": "linux & !static"
+ }
+ ]
+}