Skip to content

Commit

Permalink
Update to XAudio2Redist 1.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Oct 16, 2021
1 parent 5b80b15 commit a0f8fcd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .nuget/directxtk_desktop_2017.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DirectX Tool Kit for Audio in this package uses XAudio2Redist NuGet package to s
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>DirectX DirectXTK native nativepackage</tags>
<dependencies>
<dependency id="Microsoft.XAudio2.Redist" version="1.2.7" />
<dependency id="Microsoft.XAudio2.Redist" version="1.2.8" />
</dependencies>
</metadata>

Expand Down
4 changes: 2 additions & 2 deletions Audio/DirectXTKAudio_Desktop_2017_Win7.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.XAudio2.Redist.1.2.7\build\native\Microsoft.XAudio2.Redist.targets" Condition="Exists('..\packages\Microsoft.XAudio2.Redist.1.2.7\build\native\Microsoft.XAudio2.Redist.targets')" />
<Import Project="..\packages\Microsoft.XAudio2.Redist.1.2.8\build\native\Microsoft.XAudio2.Redist.targets" Condition="Exists('..\packages\Microsoft.XAudio2.Redist.1.2.8\build\native\Microsoft.XAudio2.Redist.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.XAudio2.Redist.1.2.7\build\native\Microsoft.XAudio2.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.XAudio2.Redist.1.2.7\build\native\Microsoft.XAudio2.Redist.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.XAudio2.Redist.1.2.8\build\native\Microsoft.XAudio2.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.XAudio2.Redist.1.2.8\build\native\Microsoft.XAudio2.Redist.targets'))" />
</Target>
</Project>
4 changes: 2 additions & 2 deletions Audio/DirectXTKAudio_Desktop_2019_Win7.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.XAudio2.Redist.1.2.7\build\native\Microsoft.XAudio2.Redist.targets" Condition="Exists('..\packages\Microsoft.XAudio2.Redist.1.2.7\build\native\Microsoft.XAudio2.Redist.targets')" />
<Import Project="..\packages\Microsoft.XAudio2.Redist.1.2.8\build\native\Microsoft.XAudio2.Redist.targets" Condition="Exists('..\packages\Microsoft.XAudio2.Redist.1.2.8\build\native\Microsoft.XAudio2.Redist.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.XAudio2.Redist.1.2.7\build\native\Microsoft.XAudio2.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.XAudio2.Redist.1.2.7\build\native\Microsoft.XAudio2.Redist.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.XAudio2.Redist.1.2.8\build\native\Microsoft.XAudio2.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.XAudio2.Redist.1.2.8\build\native\Microsoft.XAudio2.Redist.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Audio/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.XAudio2.Redist" version="1.2.7" targetFramework="native" />
<package id="Microsoft.XAudio2.Redist" version="1.2.8" targetFramework="native" />
</packages>
18 changes: 3 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,9 @@ endif()
if (BUILD_XAUDIO_WIN7 AND (NOT BUILD_XAUDIO_WIN10) AND (NOT BUILD_XAUDIO_WIN8) AND (NOT WINDOWS_STORE))
message("INFO: Using XAudio2Redist for DirectX Tool Kit for Audio on Windows 7.")
target_compile_definitions(${PROJECT_NAME} PRIVATE USING_XAUDIO2_REDIST)
if(NOT xaudio2redist_DIR)
if (VCPKG_TOOLCHAIN)
if (NOT EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/xaudio2redist/xaudio2.h")
message(FATAL_ERROR "VCPKG port 'xaudio2redist' required for DirectX Tool Kit for Audio on Windows 7")
endif()
target_include_directories(${PROJECT_NAME} PRIVATE ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/xaudio2redist)
else()
message(FATAL_ERROR "Requires xaudio2redist either via VCPKG or by setting xaudio2redist_DIR to installed NuGet")
endif()
else()
if (NOT EXISTS "${xaudio2redist_DIR}/build/native/include/xaudio2.h")
message(FATAL_ERROR "Requires xaudio2redist either via VCPKG or by setting xaudio2redist_DIR to installed NuGet")
endif()
target_include_directories(${PROJECT_NAME} PRIVATE ${xaudio2redist_DIR}/build/native/include)
endif()

find_package(xaudio2redist CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::XAudio2Redist)
endif()

#--- Package
Expand Down

1 comment on commit a0f8fcd

@walbourn
Copy link
Member Author

@walbourn walbourn commented on a0f8fcd Oct 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake changes rely on Findxaudio2redist.cmake addition to vcpkg in this PR

Please sign in to comment.