Skip to content

Commit

Permalink
CMake BUILD_XAUDIO_WIN7 now BUILD_XAUDIO_REDIST
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Dec 6, 2024
1 parent 7483887 commit 9a2bc11
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ option(BUILD_TOOLS "Build XWBTool" ON)

option(BUILD_XAUDIO_WIN10 "Build for XAudio 2.9" OFF)
option(BUILD_XAUDIO_WIN8 "Build for XAudio 2.8" ON)
option(BUILD_XAUDIO_WIN7 "Build for XAudio2Redist" OFF)
option(BUILD_XAUDIO_REDIST "Build for XAudio2Redist" OFF)

option(BUILD_GAMEINPUT "Build for GameInput" OFF)
option(BUILD_WGI "Build for Windows.Gaming.Input" OFF)
Expand Down Expand Up @@ -182,12 +182,12 @@ if(MINGW)
endif()

if(${DIRECTX_ARCH} MATCHES "^arm")
set(BUILD_XAUDIO_WIN7 OFF)
set(BUILD_XAUDIO_REDIST OFF)
endif()

if(WINDOWS_STORE
OR BUILD_XAUDIO_WIN10 OR BUILD_XAUDIO_WIN8
OR BUILD_XAUDIO_WIN7)
OR BUILD_XAUDIO_REDIST)
set(LIBRARY_HEADERS ${LIBRARY_HEADERS}
Inc/Audio.h)

Expand Down Expand Up @@ -265,7 +265,7 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)

if(WINDOWS_STORE
OR BUILD_XAUDIO_WIN10 OR BUILD_XAUDIO_WIN8
OR BUILD_XAUDIO_WIN7)
OR BUILD_XAUDIO_REDIST)
target_include_directories(${PROJECT_NAME} PRIVATE Audio)
endif()

Expand All @@ -281,9 +281,9 @@ if(directxmath_FOUND)
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMath)
endif()

if(BUILD_XAUDIO_WIN7
if(BUILD_XAUDIO_REDIST
AND (NOT BUILD_XAUDIO_WIN10) AND (NOT BUILD_XAUDIO_WIN8) AND (NOT WINDOWS_STORE))
message(STATUS "Using XAudio2Redist for DirectX Tool Kit for Audio on Windows 7.")
message(STATUS "Using XAudio2Redist for DirectX Tool Kit for Audio.")
find_package(xaudio2redist CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::XAudio2Redist)
target_compile_definitions(${PROJECT_NAME} PUBLIC USING_XAUDIO2_REDIST)
Expand Down
40 changes: 20 additions & 20 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@
},

{
"name": "Win7",
"name": "XAudio2Redist",
"cacheVariables": {
"BUILD_XAUDIO_WIN10": false,
"BUILD_XAUDIO_WIN8": false,
"BUILD_XAUDIO_WIN7": true,
"BUILD_XAUDIO_REDIST": true,
"BUILD_XINPUT": true
},
"hidden": true
Expand All @@ -132,7 +132,7 @@
"cacheVariables": {
"BUILD_XAUDIO_WIN10": true,
"BUILD_XAUDIO_WIN8": false,
"BUILD_XAUDIO_WIN7": false,
"BUILD_XAUDIO_REDIST": false,
"BUILD_WGI": true
},
"hidden": true
Expand All @@ -150,7 +150,7 @@
"cacheVariables": {
"BUILD_XAUDIO_WIN10": true,
"BUILD_XAUDIO_WIN8": false,
"BUILD_XAUDIO_WIN7": false,
"BUILD_XAUDIO_REDIST": false,
"BUILD_GAMEINPUT": true
},
"hidden": true
Expand Down Expand Up @@ -267,10 +267,10 @@
{ "name": "arm64-Debug-UWP" , "description": "MSVC for ARM64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "MSVC", "UWP" ] },
{ "name": "arm64-Release-UWP", "description": "MSVC for ARM64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "MSVC", "UWP" ] },

{ "name": "x64-Debug-Win7" , "description": "MSVC for x64 (Debug) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x64", "Debug", "MSVC", "Win7", "VCPKG" ] },
{ "name": "x64-Release-Win7", "description": "MSVC for x64 (Release) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x64", "Release", "MSVC", "Win7", "VCPKG" ] },
{ "name": "x86-Debug-Win7" , "description": "MSVC for x86 (Debug) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x86", "Debug", "MSVC", "Win7", "VCPKG" ] },
{ "name": "x86-Release-Win7", "description": "MSVC for x86 (Release) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x86", "Release", "MSVC", "Win7", "VCPKG" ] },
{ "name": "x64-Debug-Redist" , "description": "MSVC for x64 (Debug) with XAudio2Redist", "inherits": [ "base", "x64", "Debug", "MSVC", "XAudio2Redist", "VCPKG" ] },
{ "name": "x64-Release-Redist", "description": "MSVC for x64 (Release) with XAudio2Redist", "inherits": [ "base", "x64", "Release", "MSVC", "XAudio2Redist", "VCPKG" ] },
{ "name": "x86-Debug-Redist" , "description": "MSVC for x86 (Debug) with XAudio2Redist", "inherits": [ "base", "x86", "Debug", "MSVC", "XAudio2Redist", "VCPKG" ] },
{ "name": "x86-Release-Redist", "description": "MSVC for x86 (Release) with XAudio2Redist", "inherits": [ "base", "x86", "Release", "MSVC", "XAudio2Redist", "VCPKG" ] },

{ "name": "x64-Debug-GDK" , "description": "MSVC for x64 (Debug) with Microsoft GDK", "inherits": [ "base", "x64", "Debug", "MSVC", "GDK" ] },
{ "name": "x64-Release-GDK" , "description": "MSVC for x64 (Release) with Microsoft GDK", "inherits": [ "base", "x64", "Release", "MSVC", "GDK" ] },
Expand Down Expand Up @@ -308,10 +308,10 @@
{ "name": "arm64-Debug-UWP-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64", "UWP" ] },
{ "name": "arm64-Release-UWP-Clang", "description": "Clang/LLVM for AArch64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64", "UWP" ] },

{ "name": "x64-Debug-Win7-Clang" , "description": "Clang/LLVM for x64 (Debug) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x64", "Debug", "Clang", "Win7", "VCPKG" ] },
{ "name": "x64-Release-Win7-Clang", "description": "Clang/LLVM for x64 (Release) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x64", "Release", "Clang", "Win7", "VCPKG" ] },
{ "name": "x86-Debug-Win7-Clang" , "description": "Clang/LLVM for x86 (Debug) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "Win7", "VCPKG" ] },
{ "name": "x86-Release-Win7-Clang", "description": "Clang/LLVM for x86 (Release) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "Win7", "VCPKG" ] },
{ "name": "x64-Debug-Redist-Clang" , "description": "Clang/LLVM for x64 (Debug) with XAudio2Redist", "inherits": [ "base", "x64", "Debug", "Clang", "XAudio2Redist", "VCPKG" ] },
{ "name": "x64-Release-Redist-Clang", "description": "Clang/LLVM for x64 (Release) with XAudio2Redist", "inherits": [ "base", "x64", "Release", "Clang", "XAudio2Redist", "VCPKG" ] },
{ "name": "x86-Debug-Redist-Clang" , "description": "Clang/LLVM for x86 (Debug) with XAudio2Redist", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "XAudio2Redist", "VCPKG" ] },
{ "name": "x86-Release-Redist-Clang", "description": "Clang/LLVM for x86 (Release) with XAudio2Redist", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "XAudio2Redist", "VCPKG" ] },

{ "name": "x64-Debug-Clang-VCPKG" , "description": "Clang/LLVM for x64 (Debug) using VCPKG", "inherits": [ "base", "x64", "Debug", "Clang", "VCPKG" ] },
{ "name": "x64-Release-Clang-VCPKG" , "description": "Clang/LLVM for x64 (Release) using VCPKG", "inherits": [ "base", "x64", "Release", "Clang", "VCPKG" ] },
Expand All @@ -321,10 +321,10 @@
{ "name": "x64-Debug-GDK-Clang" , "description": "Clang/LLVM for x64 (Debug) with Microsoft GDK", "inherits": [ "base", "x64", "Debug", "Clang", "GDK" ] },
{ "name": "x64-Release-GDK-Clang" , "description": "Clang/LLVM for x64 (Release) with Microsoft GDK", "inherits": [ "base", "x64", "Release", "Clang", "GDK" ] },

{ "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC", "VCPKG", "MinGW64", "Win7" ] },
{ "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC", "VCPKG", "MinGW64", "Win7" ] },
{ "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC", "VCPKG", "MinGW32", "Win7" ] },
{ "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC", "VCPKG", "MinGW32", "Win7" ] },
{ "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC", "VCPKG", "MinGW64", "XAudio2Redist" ] },
{ "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC", "VCPKG", "MinGW64", "XAudio2Redist" ] },
{ "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC", "VCPKG", "MinGW32", "XAudio2Redist" ] },
{ "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC", "VCPKG", "MinGW32", "XAudio2Redist" ] },

{ "name": "x64-Debug-ICC" , "description": "Intel Classic Compiler (Debug) for Windows 8", "inherits": [ "base", "x64", "Debug", "Intel" ] },
{ "name": "x64-Release-ICC" , "description": "Intel Classic Compiler (Release) for Windows 8", "inherits": [ "base", "x64", "Release", "Intel" ] },
Expand All @@ -349,10 +349,10 @@
{ "name": "arm64ec-Debug" , "configurePreset": "arm64ec-Debug" },
{ "name": "arm64ec-Release", "configurePreset": "arm64ec-Release" },

{ "name": "x64-Debug-Win7" , "configurePreset": "x64-Debug-Win7" },
{ "name": "x64-Release-Win7" , "configurePreset": "x64-Release-Win7" },
{ "name": "x86-Debug-Win7" , "configurePreset": "x86-Debug-Win7" },
{ "name": "x86-Release-Win7" , "configurePreset": "x86-Release-Win7" },
{ "name": "x64-Debug-Redist" , "configurePreset": "x64-Debug-Redist" },
{ "name": "x64-Release-Redist" , "configurePreset": "x64-Release-Redist" },
{ "name": "x86-Debug-Redist" , "configurePreset": "x86-Debug-Redist" },
{ "name": "x86-Release-Redist" , "configurePreset": "x86-Release-Redist" },

{ "name": "x64-Debug-Clang" , "configurePreset": "x64-Debug-Clang" },
{ "name": "x64-Release-Clang" , "configurePreset": "x64-Release-Clang" },
Expand Down

0 comments on commit 9a2bc11

Please sign in to comment.