vcpkg/ports/directxtk12/portfile.cmake

86 lines
3.1 KiB
CMake
Raw Normal View History

set(DIRECTXTK_TAG jun2024)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTK12
REF ${DIRECTXTK_TAG}
SHA512 c56e8344abe21ddb525744458473073c68373b9bce4ffbf00a8a5ac3842d53a010e911dcaa19dcf012065c15e4c97df3de8a6c5bac5be56da0b0d05fe6932961
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 "")
[community triplet] adds triplets for building for the Xbox platform (#29210) * Try adding xbox triplets * Update for Gaming Command Prompt usage * Fix directxtk12 shaders for xbox * Add toolchain for xbox * Fix ports for feature builds * Code review feedback * More code review * Code review * WIN32_LEAN_AND_MEAN is too aggressive for many libs * Normalize GDK variable paths * Need to leave oldnames.lib as many libs use POSIX names * More code review feedback * Remove extra file * Use of /DEFAULTLIB fixed 41 ports * Code review feedback * Added basic xbox supports expression * Updates for xbox-aware ports * Update for CMake fixes upstream * Minor synatx fix * Fix up merge issues * Need directx-headers for linux * Missed one port revision * Removed VCPKG_TARGET_IS_XBOX from project scope after upstream fixes * Update baseline * License updates per github-actions bot * Update baseline * Update toolchain to support try_compile for GDK headers * Update port numbers * Update baseline * Don't need directx-dxc for Xbox builds * Update baseline * Update hashes * Code review * Update baseline * Refresh hashes for upstream fixes * Update baseline * Add ms-gdkx stub port * Update baseline * updated ms-gdkx with user-friendly output * Update baseline * Code review for the toolchain file * Update directxkt12 hash * Refresh baseline * Update MSBuild integration to select proper triplet for GDK custom platforms * Update CMake integration to select proper xbox triplet from XBOX_CONSOLE_TARGET * vcpkg.targets update * Code review feedback * Update baseline * Refresh baseline * Code review for MSBuild * Code review for xbox toolchain * vcpkg.cmake codereview --------- Co-authored-by: walbourn <chuckw_walbourn@yahoo.com>
2023-03-09 06:06:20 +08:00
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}"
[community triplet] adds triplets for building for the Xbox platform (#29210) * Try adding xbox triplets * Update for Gaming Command Prompt usage * Fix directxtk12 shaders for xbox * Add toolchain for xbox * Fix ports for feature builds * Code review feedback * More code review * Code review * WIN32_LEAN_AND_MEAN is too aggressive for many libs * Normalize GDK variable paths * Need to leave oldnames.lib as many libs use POSIX names * More code review feedback * Remove extra file * Use of /DEFAULTLIB fixed 41 ports * Code review feedback * Added basic xbox supports expression * Updates for xbox-aware ports * Update for CMake fixes upstream * Minor synatx fix * Fix up merge issues * Need directx-headers for linux * Missed one port revision * Removed VCPKG_TARGET_IS_XBOX from project scope after upstream fixes * Update baseline * License updates per github-actions bot * Update baseline * Update toolchain to support try_compile for GDK headers * Update port numbers * Update baseline * Don't need directx-dxc for Xbox builds * Update baseline * Update hashes * Code review * Update baseline * Refresh hashes for upstream fixes * Update baseline * Add ms-gdkx stub port * Update baseline * updated ms-gdkx with user-friendly output * Update baseline * Code review for the toolchain file * Update directxkt12 hash * Refresh baseline * Update MSBuild integration to select proper triplet for GDK custom platforms * Update CMake integration to select proper xbox triplet from XBOX_CONSOLE_TARGET * vcpkg.targets update * Code review feedback * Update baseline * Refresh baseline * Code review for MSBuild * Code review for xbox toolchain * vcpkg.cmake codereview --------- Co-authored-by: walbourn <chuckw_walbourn@yahoo.com>
2023-03-09 06:06:20 +08:00
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 e516558dbe6d1364a7bd747a0af83033e226ff62e89ae45d876e12f67f42b39351e9ddc98f701c172f78075ef93fbbab9ca732257bad7b161632cacbb1085df6
)
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 4fb31b291acae6d5f9266c2d8c975396df7f33a0fd7c667e1ec56ad2090f7822aaa39d25fddb2406a655f9060ab205810ed1ce440d2454d0f55771823327fd9e
)
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)
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 a11d144388f8d3fc235a67b12e8ecb0c4325f89d61572e0110aa5894ade851fd9850595ee5d838965c1a1f04d45a63712e027836e1ac03870880e9c777c10b0f
)
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")