mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-17 23:27:54 +08:00
86 lines
3.2 KiB
CMake
86 lines
3.2 KiB
CMake
set(DIRECTXTK_TAG sep2024)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO Microsoft/DirectXTK12
|
|
REF ${DIRECTXTK_TAG}
|
|
SHA512 902f2ee19953cb36e5982930f3f2cdd7915fadc0e2e97388e44ce677dd9598ccd588b9157179edd2348cef48af7061944083ada1398a47a6805c5d7c1c4c73d3
|
|
HEAD_REF main
|
|
)
|
|
|
|
vcpkg_check_features(
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
spectre ENABLE_SPECTRE_MITIGATION
|
|
xaudio2-9 BUILD_XAUDIO_WIN10
|
|
xaudio2redist BUILD_XAUDIO_REDIST
|
|
)
|
|
|
|
set(EXTRA_OPTIONS "")
|
|
|
|
if(NOT VCPKG_TARGET_IS_XBOX)
|
|
set(DXCPATH "${CURRENT_HOST_INSTALLED_DIR}/tools/directx-dxc")
|
|
list(APPEND EXTRA_OPTIONS -DBUILD_DXIL_SHADERS=ON "-DDIRECTX_DXC_PATH=${DXCPATH}")
|
|
endif()
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS ${FEATURE_OPTIONS} ${EXTRA_OPTIONS}
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
vcpkg_fixup_pkgconfig()
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH share/directxtk12)
|
|
|
|
if("tools" IN_LIST FEATURES)
|
|
|
|
vcpkg_download_distfile(
|
|
MAKESPRITEFONT_EXE
|
|
URLS "https://github.com/Microsoft/DirectXTK12/releases/download/${DIRECTXTK_TAG}/MakeSpriteFont.exe"
|
|
FILENAME "makespritefont-${DIRECTXTK_TAG}.exe"
|
|
SHA512 15ba6d2b17a43335782cd0f34c017085a747d3308a73f2ae48423873c7e2e3a22bae292c2dc812b67077f96faa41ba81cca4f8a3a36f497f7f6517e24f41474b
|
|
)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxtk12/")
|
|
|
|
file(INSTALL "${MAKESPRITEFONT_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk12/")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk12/makespritefont-${DIRECTXTK_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk12/makespritefont.exe")
|
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
|
|
|
|
vcpkg_download_distfile(
|
|
XWBTOOL_EXE
|
|
URLS "https://github.com/Microsoft/DirectXTK12/releases/download/${DIRECTXTK_TAG}/XWBTool.exe"
|
|
FILENAME "xwbtool-${DIRECTXTK_TAG}.exe"
|
|
SHA512 33413514de463d771950caab415cd1ae499dd9ab8f7b2580e7de6e7a49e413f35cd44f8f0a561a1f99f331e5375d91f81b2d47184c4ab30d326feab2c49a82bc
|
|
)
|
|
|
|
file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk12/")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk12/xwbtool-${DIRECTXTK_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk12/xwbtool.exe")
|
|
|
|
elseif((VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) OR (VCPKG_TARGET_ARCHITECTURE STREQUAL arm64ec))
|
|
|
|
vcpkg_download_distfile(
|
|
XWBTOOL_EXE
|
|
URLS "https://github.com/Microsoft/DirectXTK12/releases/download/${DIRECTXTK_TAG}/XWBTool_arm64.exe"
|
|
FILENAME "xwbtool-${DIRECTXTK_TAG}-arm64.exe"
|
|
SHA512 90af7b04ee0b152e3f08891f85cf970330d2ff16e6f7ac2269f4a5803dddb891e0cca186c56ef38d2b64f40c86889e31f0c4b017845decf3e6660c9654a0eea8
|
|
)
|
|
|
|
file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk12/")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk12/xwbtool-${DIRECTXTK_TAG}-arm64.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk12/xwbtool.exe")
|
|
|
|
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")
|