diff options
Diffstat (limited to 'vcpkg/ports/directxtk')
| -rw-r--r-- | vcpkg/ports/directxtk/CMake-build-options-improvements.patch | 161 | ||||
| -rw-r--r-- | vcpkg/ports/directxtk/portfile.cmake | 91 | ||||
| -rw-r--r-- | vcpkg/ports/directxtk/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/directxtk/vcpkg.json | 52 |
4 files changed, 308 insertions, 0 deletions
diff --git a/vcpkg/ports/directxtk/CMake-build-options-improvements.patch b/vcpkg/ports/directxtk/CMake-build-options-improvements.patch new file mode 100644 index 0000000..d80b7b7 --- /dev/null +++ b/vcpkg/ports/directxtk/CMake-build-options-improvements.patch @@ -0,0 +1,161 @@ +--- + CMakeLists.txt | 66 +++++++++++++++++++++++++++-------------------- + CMakePresets.json | 6 +++-- + 2 files changed, 42 insertions(+), 30 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 70db51f..de2ccfb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -60,14 +60,28 @@ if(XBOX_CONSOLE_TARGET STREQUAL "durango") + set(BUILD_GAMEINPUT OFF) + set(BUILD_WGI OFF) + set(BUILD_XINPUT OFF) +- set(BUILD_XBOXONE_SHADERS ON) + set(BUILD_XAUDIO_WIN10 OFF) + set(BUILD_XAUDIO_WIN8 ON) ++ set(BUILD_XAUDIO_REDIST OFF) ++ set(BUILD_XBOXONE_SHADERS ON) + set(BUILD_TOOLS OFF) + elseif(WINDOWS_STORE) + set(BUILD_GAMEINPUT OFF) + set(BUILD_WGI ON) ++ set(BUILD_XINPUT OFF) ++ set(BUILD_XAUDIO_WIN10 ON) ++ set(BUILD_XAUDIO_WIN8 OFF) ++ set(BUILD_XAUDIO_REDIST OFF) + set(BUILD_TOOLS OFF) ++elseif(MINGW) ++ set(BUILD_WGI OFF) ++ set(BUILD_XAUDIO_WIN10 OFF) ++ set(BUILD_XAUDIO_WIN8 OFF) ++ if (NOT BUILD_GAMEINPUT) ++ set(BUILD_XINPUT ON) ++ endif() ++elseif(WIN32 AND (NOT BUILD_GAMEINPUT) AND (NOT BUILD_WGI)) ++ set(BUILD_XINPUT ON) + endif() + + include(GNUInstallDirs) +@@ -145,29 +159,14 @@ set(SHADER_SOURCES + Src/Shaders/SpriteEffect.fx + Src/Shaders/ToneMap.fx) + +-# Xbox-specific extensions +-if(DEFINED XBOX_CONSOLE_TARGET) +- set(LIBRARY_HEADERS ${LIBRARY_HEADERS} +- Inc/XboxDDSTextureLoader.h) +- +- set(LIBRARY_SOURCES ${LIBRARY_SOURCES} +- Src/XboxDDSTextureLoader.cpp) +-endif() +- + # These source files are identical in both DX11 and DX12 version. + set(LIBRARY_HEADERS ${LIBRARY_HEADERS} +- Inc/GamePad.h +- Inc/Keyboard.h +- Inc/Mouse.h + Inc/SimpleMath.h + Inc/SimpleMath.inl) + + set(LIBRARY_SOURCES ${LIBRARY_SOURCES} + Src/BinaryReader.cpp +- Src/GamePad.cpp + Src/Geometry.cpp +- Src/Keyboard.cpp +- Src/Mouse.cpp + Src/SimpleMath.cpp) + + set(LIBRARY_SOURCES ${LIBRARY_SOURCES} +@@ -193,14 +192,28 @@ set(SHADER_SOURCES ${SHADER_SOURCES} + Src/Shaders/Structures.fxh + Src/Shaders/Utilities.fxh) + +-if(MINGW) +- set(BUILD_XAUDIO_WIN10 OFF) +- set(BUILD_XAUDIO_WIN8 OFF) ++# Xbox-specific extensions ++if(DEFINED XBOX_CONSOLE_TARGET) ++ set(LIBRARY_HEADERS ${LIBRARY_HEADERS} ++ Inc/XboxDDSTextureLoader.h) ++ ++ set(LIBRARY_SOURCES ${LIBRARY_SOURCES} ++ Src/XboxDDSTextureLoader.cpp) ++endif() ++ ++if(BUILD_XINPUT OR BUILD_WGI OR BUILD_GAMEINPUT) ++ set(LIBRARY_HEADERS ${LIBRARY_HEADERS} ++ Inc/GamePad.h ++ Inc/Keyboard.h ++ Inc/Mouse.h) ++ ++ set(LIBRARY_SOURCES ${LIBRARY_SOURCES} ++ Src/GamePad.cpp ++ Src/Keyboard.cpp ++ Src/Mouse.cpp) + endif() + +-if(WINDOWS_STORE +- OR BUILD_XAUDIO_WIN10 OR BUILD_XAUDIO_WIN8 +- OR BUILD_XAUDIO_REDIST) ++if(BUILD_XAUDIO_WIN10 OR BUILD_XAUDIO_WIN8 OR BUILD_XAUDIO_REDIST) + set(LIBRARY_HEADERS ${LIBRARY_HEADERS} + Inc/Audio.h) + +@@ -274,7 +287,7 @@ if(WIN32 AND BUILD_SHARED_LIBS) + target_link_libraries(${PROJECT_NAME} PRIVATE kernelx.lib combase.lib d3d12_x.lib xi.lib) + endif() + +- if(MINGW) ++ if(MINGW AND BUILD_XINPUT) + target_link_libraries(${PROJECT_NAME} PRIVATE xinput1_4.lib) + endif() + else() +@@ -297,9 +310,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC + + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) + +-if(WINDOWS_STORE +- OR BUILD_XAUDIO_WIN10 OR BUILD_XAUDIO_WIN8 +- OR BUILD_XAUDIO_REDIST) ++if(BUILD_XAUDIO_WIN10 OR BUILD_XAUDIO_WIN8 OR BUILD_XAUDIO_REDIST) + target_include_directories(${PROJECT_NAME} PRIVATE Audio) + endif() + +@@ -315,8 +326,7 @@ if(directxmath_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMath) + endif() + +-if(BUILD_XAUDIO_REDIST +- AND (NOT BUILD_XAUDIO_WIN10) AND (NOT BUILD_XAUDIO_WIN8) AND (NOT WINDOWS_STORE)) ++if(BUILD_XAUDIO_REDIST AND (NOT BUILD_XAUDIO_WIN10) AND (NOT BUILD_XAUDIO_WIN8)) + message(STATUS "Using XAudio2Redist for DirectX Tool Kit for Audio.") + find_package(xaudio2redist CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::XAudio2Redist) +diff --git a/CMakePresets.json b/CMakePresets.json +index 69e1cad..03b7c7a 100644 +--- a/CMakePresets.json ++++ b/CMakePresets.json +@@ -122,8 +122,7 @@ + "cacheVariables": { + "BUILD_XAUDIO_WIN10": false, + "BUILD_XAUDIO_WIN8": false, +- "BUILD_XAUDIO_REDIST": true, +- "BUILD_XINPUT": true ++ "BUILD_XAUDIO_REDIST": true + }, + "hidden": true + }, +@@ -324,6 +323,9 @@ + { "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC", "VCPKG", "XAudio2Redist", "MinGW32" ] }, + { "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC", "VCPKG", "XAudio2Redist", "MinGW32" ] }, + ++ { "name": "x64-Debug-MinGW-GI" , "description": "MinG-W64 (Debug) using GameInput", "inherits": [ "base", "x64", "Debug", "GNUC", "VCPKG", "XAudio2Redist", "MinGW64" ], "cacheVariables": { "BUILD_GAMEINPUT": "true" } }, ++ { "name": "x64-Release-MinGW-GI", "description": "MinG-W64 (Release) using GameInput", "inherits": [ "base", "x64", "Release", "GNUC", "VCPKG", "XAudio2Redist", "MinGW64" ], "cacheVariables": { "BUILD_GAMEINPUT": "true" } }, ++ + { "name": "x64-Debug-ICC" , "description": "Intel Classic Compiler (Debug) for Windows 8", "inherits": [ "base", "x64", "Debug", "Intel" ] }, + { "name": "x64-Release-ICC" , "description": "Intel Classic Compiler (Release) for Windows 8", "inherits": [ "base", "x64", "Release", "Intel" ] }, + +-- +2.51.2.windows.1 + diff --git a/vcpkg/ports/directxtk/portfile.cmake b/vcpkg/ports/directxtk/portfile.cmake new file mode 100644 index 0000000..cff699f --- /dev/null +++ b/vcpkg/ports/directxtk/portfile.cmake @@ -0,0 +1,91 @@ +set(DIRECTXTK_TAG oct2025) + +if(VCPKG_TARGET_IS_MINGW) + message(NOTICE "Building ${PORT} for MinGW requires the HLSL Compiler fxc.exe also be in the PATH. See https://aka.ms/windowssdk.") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Microsoft/DirectXTK + REF ${DIRECTXTK_TAG} + SHA512 3be2fce3c3a34a22b7bdfda914ca45930c5b979bb467530b8cbb510c0f58485056c285ff86ddaecbc5aac95ae67f0b92c4e1dd8261cee4a87cf3e7056329ac28 + HEAD_REF main + PATCHES CMake-build-options-improvements.patch +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + gameinput BUILD_GAMEINPUT + windows-gaming-input BUILD_WGI + spectre ENABLE_SPECTRE_MITIGATION + tools BUILD_TOOLS + xaudio2-9 BUILD_XAUDIO_WIN10 + xaudio2-8 BUILD_XAUDIO_WIN8 + xaudio2redist BUILD_XAUDIO_REDIST +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH share/directxtk) + +if("tools" IN_LIST FEATURES) + + vcpkg_download_distfile( + MAKESPRITEFONT_EXE + URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/MakeSpriteFont.exe" + FILENAME "makespritefont-${DIRECTXTK_TAG}.exe" + SHA512 edec18a1c7790d6f27f8d910307a38a037784cc974b38debb8ef6eb77369941b60bf7cb52de4150f80bca4ab541d76d54f21ef91524b83b11b684f0a92e1c879 + ) + + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxtk/") + + file(INSTALL "${MAKESPRITEFONT_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk/") + + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk/makespritefont-${DIRECTXTK_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk/makespritefont.exe") + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + + vcpkg_download_distfile( + XWBTOOL_EXE + URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/XWBTool.exe" + FILENAME "xwbtool-${DIRECTXTK_TAG}.exe" + SHA512 68ff3f4a99585e08698c6385550628341e31218315029700c9b8d9a17118ba964856358bc2bebc951b6ec8d1584e8d62138505780897430509dca2652832384b + ) + + file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk/") + + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk/xwbtool-${DIRECTXTK_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk/xwbtool.exe") + + elseif((VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) OR (VCPKG_TARGET_ARCHITECTURE STREQUAL arm64ec)) + + vcpkg_download_distfile( + XWBTOOL_EXE + URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/XWBTool_arm64.exe" + FILENAME "xwbtool-${DIRECTXTK_TAG}-arm64.exe" + SHA512 8e9d0fdd206bff4e3c0b344ed754a16cee913833be205c822d41ed3264d3578ae168ef415043ff8f95b38890c37457a56ee7677b26d95b8afd60dd307bffb9e0 + ) + + file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk/") + + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk/xwbtool-${DIRECTXTK_TAG}-arm64.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk/xwbtool.exe") + + else() + + vcpkg_copy_tools( + TOOL_NAMES XWBTool + SEARCH_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin" + ) + + endif() +endif() + +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 "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/directxtk/usage b/vcpkg/ports/directxtk/usage new file mode 100644 index 0000000..e1f79f6 --- /dev/null +++ b/vcpkg/ports/directxtk/usage @@ -0,0 +1,4 @@ +The DirectX Tool Kit for DX11 package provides CMake targets:
+
+ find_package(directxtk CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Microsoft::DirectXTK)
diff --git a/vcpkg/ports/directxtk/vcpkg.json b/vcpkg/ports/directxtk/vcpkg.json new file mode 100644 index 0000000..27e9656 --- /dev/null +++ b/vcpkg/ports/directxtk/vcpkg.json @@ -0,0 +1,52 @@ +{ + "name": "directxtk", + "version-date": "2025-10-27", + "description": "A collection of helper classes for writing DirectX 11.x code in C++.", + "homepage": "https://github.com/Microsoft/DirectXTK", + "documentation": "https://github.com/microsoft/DirectXTK/wiki", + "license": "MIT", + "supports": "windows & !xbox & !arm32", + "dependencies": [ + "directxmath", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "gameinput": { + "description": "Build using GameInput API for input processing", + "supports": "windows & x64 & !uwp", + "dependencies": [ + "gameinput" + ] + }, + "spectre": { + "description": "Build Spectre-mitigated library" + }, + "tools": { + "description": "MakeSpriteFont and xwbtool command-line tools", + "supports": "windows & !uwp & !xbox" + }, + "windows-gaming-input": { + "description": "Build using Windows.Gaming.Input for input processing", + "supports": "windows & !xbox" + }, + "xaudio2-8": { + "description": "Build with XAudio 2.8 support for Windows 8.x or later" + }, + "xaudio2-9": { + "description": "Build with XAudio 2.9 support for Windows 10/11" + }, + "xaudio2redist": { + "description": "Build with XAudio2Redist support for Windows 8.1 or later", + "dependencies": [ + "xaudio2redist" + ] + } + } +} |