aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/xaudio2redist
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/xaudio2redist
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/xaudio2redist')
-rw-r--r--vcpkg/ports/xaudio2redist/portfile.cmake54
-rw-r--r--vcpkg/ports/xaudio2redist/usage4
-rw-r--r--vcpkg/ports/xaudio2redist/vcpkg.json9
-rw-r--r--vcpkg/ports/xaudio2redist/xaudio2redist-config.cmake.in34
4 files changed, 101 insertions, 0 deletions
diff --git a/vcpkg/ports/xaudio2redist/portfile.cmake b/vcpkg/ports/xaudio2redist/portfile.cmake
new file mode 100644
index 0000000..f65ca23
--- /dev/null
+++ b/vcpkg/ports/xaudio2redist/portfile.cmake
@@ -0,0 +1,54 @@
+
+set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://www.nuget.org/api/v2/package/Microsoft.XAudio2.Redist/${VERSION}"
+ FILENAME "xaudio2redist.${VERSION}.zip"
+ SHA512 2d2a605cda22d2c6e7918d52cb673cb0b4f4e7c2b4b6ee3e1f988431f5cb6f945a17988574e0faca9465fc4370b222e9e8e23215525f3d6b5c276b1e3dc4476e
+)
+
+vcpkg_extract_source_archive(
+ PACKAGE_PATH
+ ARCHIVE ${ARCHIVE}
+ NO_REMOVE_ONE_LEVEL
+)
+
+if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64|arm64ec")
+ set(XAUDIO_ARCH arm64)
+else()
+ set(XAUDIO_ARCH ${VCPKG_TARGET_ARCHITECTURE})
+endif()
+
+file(GLOB HEADER_FILES "${PACKAGE_PATH}/build/native/include/*.h")
+file(INSTALL ${HEADER_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}")
+
+file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${XAUDIO_ARCH}/xaudio2_9redist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+
+if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
+ file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${XAUDIO_ARCH}/xapobaseredist_md.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ set(lib_suffix "_md")
+else()
+ file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${XAUDIO_ARCH}/xapobaseredist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ set(lib_suffix "")
+endif()
+
+file(INSTALL "${PACKAGE_PATH}/build/native/release/bin/${XAUDIO_ARCH}/xaudio2_9redist.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
+
+if(NOT DEFINED VCPKG_BUILD_TYPE)
+ file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${XAUDIO_ARCH}/xaudio2_9redist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+
+ if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
+ file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${XAUDIO_ARCH}/xapobaseredist_md.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+ else()
+ file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${XAUDIO_ARCH}/xapobaseredist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+ endif()
+
+ file(INSTALL "${PACKAGE_PATH}/build/native/debug/bin/${XAUDIO_ARCH}/xaudio2_9redist.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+configure_file("${CMAKE_CURRENT_LIST_DIR}/xaudio2redist-config.cmake.in"
+ "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake"
+ @ONLY)
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${PACKAGE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/xaudio2redist/usage b/vcpkg/ports/xaudio2redist/usage
new file mode 100644
index 0000000..6c0f1c2
--- /dev/null
+++ b/vcpkg/ports/xaudio2redist/usage
@@ -0,0 +1,4 @@
+The XAudio2 redistributable package provides CMake targets
+
+ find_package(xaudio2redist CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Microsoft::XAudio2Redist)
diff --git a/vcpkg/ports/xaudio2redist/vcpkg.json b/vcpkg/ports/xaudio2redist/vcpkg.json
new file mode 100644
index 0000000..ef8e81b
--- /dev/null
+++ b/vcpkg/ports/xaudio2redist/vcpkg.json
@@ -0,0 +1,9 @@
+{
+ "name": "xaudio2redist",
+ "version": "1.2.13",
+ "description": "Redistributable version of XAudio 2.9 for Windows 7 SP1 or later",
+ "homepage": "https://aka.ms/XAudio2Redist",
+ "documentation": "https://aka.ms/XAudio2Redist",
+ "license": null,
+ "supports": "windows & !arm32 & !uwp & !xbox"
+}
diff --git a/vcpkg/ports/xaudio2redist/xaudio2redist-config.cmake.in b/vcpkg/ports/xaudio2redist/xaudio2redist-config.cmake.in
new file mode 100644
index 0000000..4829ec4
--- /dev/null
+++ b/vcpkg/ports/xaudio2redist/xaudio2redist-config.cmake.in
@@ -0,0 +1,34 @@
+
+get_filename_component(_xaudio2_root "${CMAKE_CURRENT_LIST_DIR}" PATH)
+get_filename_component(_xaudio2_root "${_xaudio2_root}" PATH)
+
+set(_xaudio2_root_lib "${_xaudio2_root}/lib/xaudio2_9redist.lib")
+if (EXISTS "${_xaudio2_root_lib}")
+
+ add_library(Microsoft::XAudio2Redist SHARED IMPORTED)
+ set_target_properties(Microsoft::XAudio2Redist PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${_xaudio2_root}/bin/xaudio2_9redist.dll"
+ IMPORTED_IMPLIB_RELEASE "${_xaudio2_root_lib}"
+ IMPORTED_LOCATION_DEBUG "${_xaudio2_root}/debug/bin/xaudio2_9redist.dll"
+ IMPORTED_IMPLIB_DEBUG "${_xaudio2_root}/debug/lib/xaudio2_9redist.lib"
+ INTERFACE_INCLUDE_DIRECTORIES "${_xaudio2_root}/include/xaudio2redist"
+ IMPORTED_CONFIGURATIONS "Debug;Release"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C")
+
+ add_library(Microsoft::XApoBase STATIC IMPORTED)
+ set_target_properties(Microsoft::XApoBase PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${_xaudio2_root}/lib/xapobaseredist@lib_suffix@.lib"
+ IMPORTED_LOCATION_DEBUG "${_xaudio2_root}/debug/lib/xapobaseredist@lib_suffix@.lib"
+ INTERFACE_INCLUDE_DIRECTORIES "${_xaudio2_root}/include/xaudio2redist"
+ IMPORTED_CONFIGURATIONS "Debug;Release")
+
+ set(xaudio2redist_FOUND TRUE)
+
+else()
+
+ set(xaudio2redist_FOUND FALSE)
+
+endif()
+
+unset(_xaudio2_root_lib)
+unset(_xaudio2_root)