Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed changes #1

Merged
merged 7 commits into from
Mar 15, 2024
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
62 changes: 23 additions & 39 deletions ports/directx-dxc/directx-dxc-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@

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@"
IMPORTED_LOCATION_DEBUG "${_dxc_root}/@dll_dir@/@dll_name_dxc@"
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")

add_library(Microsoft::DXIL SHARED IMPORTED)
set_target_properties(Microsoft::DXIL PROPERTIES
IMPORTED_LOCATION_RELEASE "${_dxc_root}/@dll_dir@/@dll_name_dxil@"
IMPORTED_LOCATION_DEBUG "${_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")

target_link_libraries(Microsoft::DirectXShaderCompiler INTERFACE Microsoft::DXIL)

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@"
walbourn marked this conversation as resolved.
Show resolved Hide resolved
INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include/directx-dxc"
INTERFACE_LINK_LIBRARIES "Microsoft::DXIL"
MAP_IMPORTED_CONFIG_MINSIZEREL ""
MAP_IMPORTED_CONFIG_RELWITHDEBINFO ""
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"
MAP_IMPORTED_CONFIG_MINSIZEREL ""
MAP_IMPORTED_CONFIG_RELWITHDEBINFO ""
IMPORTED_LINK_INTERFACE_LANGUAGES "C")

unset(_dxc_exe)
unset(_dxc_root)
16 changes: 6 additions & 10 deletions ports/directx-dxc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)

walbourn marked this conversation as resolved.
Show resolved Hide resolved
set(DIRECTX_DXC_TAG v1.8.2403)
set(DIRECTX_DXC_VERSION 2024_03_07)

if (NOT VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
message(STATUS "Note: ${PORT} always requires dynamic library linkage at runtime.")
endif()
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

if (VCPKG_TARGET_IS_LINUX)
vcpkg_download_distfile(ARCHIVE
Expand Down Expand Up @@ -56,13 +52,13 @@ if (VCPKG_TARGET_IS_LINUX)

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 Down Expand Up @@ -109,14 +105,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}")
4 changes: 4 additions & 0 deletions ports/directx-dxc/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "zlib",
"platform": "!static"
}
]
}
2 changes: 1 addition & 1 deletion versions/d-/directx-dxc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "bb359aa2753ed65f6158846e29a0b9d127f29a49",
"git-tree": "4567b5dacc64424288773483ef92b48a72147f2c",
"version-date": "2024-03-07",
"port-version": 1
},
Expand Down
Loading