Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 20 additions & 27 deletions ports/directx-dxc/directx-dxc-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@

get_filename_component(_dxc_root "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_dxc_root "${_dxc_root}" PATH)
get_filename_component(_dxc_root "${CMAKE_CURRENT_LIST_DIR}" PATH)
get_filename_component(_dxc_root "${_dxc_root}" PATH)

set(_dxc_exe "${_dxc_root}/@tool_path@")
if (EXISTS "${_dxc_exe}")

add_library(Microsoft::DirectXShaderCompiler SHARED IMPORTED)
set_target_properties(Microsoft::DirectXShaderCompiler PROPERTIES
IMPORTED_LOCATION_RELEASE "${_dxc_root}/@dll_dir@/@dll_name_dxc@; ${_dxc_root}/@dll_dir@/@dll_name_dxil@"
IMPORTED_LOCATION_DEBUG "${_dxc_root}/@dll_dir@/@dll_name_dxc@; ${_dxc_root}/@dll_dir@/@dll_name_dxil@"
IMPORTED_IMPLIB_RELEASE "${_dxc_root}/lib/@lib_name@"
IMPORTED_IMPLIB_DEBUG "${_dxc_root}/lib/@lib_name@"
IMPORTED_SONAME_RELEASE "@lib_name@"
IMPORTED_SONAME_DEBUG "@lib_name@"
INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include/directx-dxc"
IMPORTED_CONFIGURATIONS "Debug;Release"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")

set(directx-dxc_FOUND TRUE)
set(DIRECTX_DXC_TOOL ${_dxc_exe})

else()

set(directx-dxc_FOUND FALSE)

endif()
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_LOCATION "${_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_LOCATION "${_dxc_root}/@dll_dir@/@dll_name_dxil@"
IMPORTED_IMPLIB "${_dxc_root}/lib/@lib_name@"
IMPORTED_SONAME "@lib_name@"
INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include/directx-dxc"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")

unset(_dxc_exe)
unset(_dxc_root)
36 changes: 22 additions & 14 deletions ports/directx-dxc/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,23 @@ if (VCPKG_TARGET_IS_LINUX)
"${PACKAGE_PATH}/lib/libdxcompiler.so"
"${PACKAGE_PATH}/lib/libdxil.so"
DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
file(INSTALL
"${PACKAGE_PATH}/lib/libdxcompiler.so"
"${PACKAGE_PATH}/lib/libdxil.so"
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/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}/bin")
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/")

set(dll_name_dxc "libdxcompiler.so")
set(dll_name_dxil "libdxil.so")
set(dll_dir "lib")
set(lib_name "libdxcompiler.so")
set(tool_path "bin/dxc")
set(tool_path "tools/${PORT}/dxc")
else()
# VCPKG_TARGET_IS_WINDOWS
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
Expand All @@ -78,16 +81,21 @@ else()
DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}")

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")
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")
file(INSTALL
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/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}/")

Expand All @@ -101,14 +109,14 @@ else()
set(dll_name_dxil "dxil.dll")
set(dll_dir "bin")
set(lib_name "dxcompiler.lib")
set(tool_path "tools/directx-dxc/dxc.exe")
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(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${LICENSE_TXT}")
5 changes: 5 additions & 0 deletions ports/directx-dxc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "directx-dxc",
"version-date": "2024-03-07",
"port-version": 1,
"description": "DirectX Shader Compiler (LLVM/Clang)",
"homepage": "https://github.com/microsoft/DirectXShaderCompiler",
"documentation": "https://github.com/microsoft/DirectXShaderCompiler/wiki",
Expand All @@ -14,6 +15,10 @@
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "zlib",
"platform": "linux & !static"
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,7 @@
},
"directx-dxc": {
"baseline": "2024-03-07",
"port-version": 0
"port-version": 1
},
"directx-headers": {
"baseline": "1.613.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/d-/directx-dxc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bf2f80689d803678032f2a8d2b8c8deff4952bb9",
"version-date": "2024-03-07",
"port-version": 1
},
{
"git-tree": "353096a360b10503e2e749b99155ba4ed6751340",
"version-date": "2024-03-07",
Expand Down