vcpkg/ports/directxtk12/portfile.cmake

84 lines
3.1 KiB
CMake
Raw Normal View History

set(DIRECTXTK_TAG mar2023)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTK12
REF ${DIRECTXTK_TAG}
SHA512 dc88aaa08085a9d2751d3d943ddb05804e25461dbd04c6fb678cff56e859f90b8df3256812a7abe03e793d04772f1c645937ce8953ebaf2edf382613d0a7b6c1
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
)
[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
set(EXTRA_OPTIONS -DBUILD_TESTING=OFF)
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_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 2a7c21356599846f10bc8adb1ec3e3ce509c9a446567ab7195e998a428e3a62629e8f6d4b7bd9fc3793a51f6eb61597b5feba49f3464ea3e4529d0991701e780
)
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 9bc9279767d6379501ec9d851cda52556eb1e96f583a162b4fad93f96985b18b2fe9d9c6eeb3f5f16b42ce2655ae3045bfe0ea0cb4aca425fe09bc079ad6a70d
)
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 b49cbe9823182b600496a449a2ff5acd08491615584c523ede4506880cb9b293cedf0b350f186ed4ef53e4795a89d1b0331559fee59ee533751086d7bb4c9e54
)
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 "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)