Skip to content

Commit

Permalink
Removed nuget.config from solution root (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored May 4, 2024
1 parent ff124de commit 44d4a41
Show file tree
Hide file tree
Showing 16 changed files with 356 additions and 63 deletions.
4 changes: 2 additions & 2 deletions Audio/SoundCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,12 @@ void DirectX::CreateXMA2(
throw std::invalid_argument("XMA2WAVEFORMATEX");
}

int blockAlign = (channels * XMA_OUTPUT_SAMPLE_BITS) / 8;
unsigned int blockAlign = (static_cast<unsigned int>(channels) * XMA_OUTPUT_SAMPLE_BITS) / 8u;

wfx->wFormatTag = WAVE_FORMAT_XMA2;
wfx->nChannels = static_cast<WORD>(channels);
wfx->nSamplesPerSec = static_cast<WORD>(sampleRate);
wfx->nAvgBytesPerSec = static_cast<DWORD>(blockAlign * sampleRate);
wfx->nAvgBytesPerSec = static_cast<DWORD>(blockAlign * static_cast<unsigned int>(sampleRate));
wfx->nBlockAlign = static_cast<WORD>(blockAlign);
wfx->wBitsPerSample = XMA_OUTPUT_SAMPLE_BITS;
wfx->cbSize = sizeof(XMA2WAVEFORMATEX) - sizeof(WAVEFORMATEX);
Expand Down
3 changes: 3 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@
{ "name": "x86-Debug-Win7-Clang" , "description": "Clang/LLVM for x86 (Debug) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x86", "Debug", "Clang", "Win7", "VCPKG" ], "environment": { "CXXFLAGS": "-m32" } },
{ "name": "x86-Release-Win7-Clang", "description": "Clang/LLVM for x86 (Release) for Windows 7 w/ XAudio2Redist", "inherits": [ "base", "x86", "Release", "Clang", "Win7", "VCPKG" ], "environment": { "CXXFLAGS": "-m32" } },

{ "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" ] },
Expand Down
10 changes: 0 additions & 10 deletions NuGet.Config

This file was deleted.

2 changes: 1 addition & 1 deletion build/CompilerAndLinker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif()
#--- Target architecture switches
if(XBOX_CONSOLE_TARGET STREQUAL "scarlett")
list(APPEND COMPILER_SWITCHES $<IF:$<CXX_COMPILER_ID:MSVC>,/favor:AMD64 /arch:AVX2,-march=znver2>)
elseif(XBOX_CONSOLE_TARGET STREQUAL "xboxone|durago")
elseif(XBOX_CONSOLE_TARGET MATCHES "xboxone|durango")
list(APPEND COMPILER_SWITCHES $<IF:$<CXX_COMPILER_ID:MSVC>,/favor:AMD64 /arch:AVX,-march=btver2>)
elseif(NOT (${DIRECTX_ARCH} MATCHES "^arm"))
if((${DIRECTX_ARCH} MATCHES "x86") OR (CMAKE_SIZEOF_VOID_P EQUAL 4))
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-CMake-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
Expand All @@ -35,6 +36,7 @@ pr:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-CMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
Expand All @@ -35,6 +36,7 @@ pr:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
Expand Down
127 changes: 122 additions & 5 deletions build/DirectXTK-GitHub-GDK-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ pr:
- main
paths:
include:
- CMakeList.txt
- build/DirectXTK-GitHub-GDK-Dev17.yml
- build/*.in
- build/*.cmake
- build/SetupBWOI.*

resources:
repositories:
Expand All @@ -39,6 +43,7 @@ variables:
GDK_EDITION: $(GDKEditionNumber)
GDKEnableBWOI: true
URL_FEED: $(ADOFeedURL)
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
skipNugetSecurityAnalysis: true # We explicitly call this task so we don't need it to be auto-injected

jobs:
Expand All @@ -54,17 +59,27 @@ jobs:
displayName: 'Use NuGet'
inputs:
versionSpec: '6.5.x'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: NuGetCommand@2
displayName: 'Set nuget.config to single source'
inputs:
command: custom
arguments: sources remove -Name nuget.org -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetCommand@2
Expand All @@ -86,6 +101,7 @@ jobs:
msbuildArchitecture: x64
- task: VSBuild@1
displayName: Build solution DirectXTK_GDK_2022 pcdbg
continueOnError: True
inputs:
solution: DirectXTK_GDK_2022.sln
vsVersion: 17.0
Expand All @@ -94,9 +110,110 @@ jobs:
msbuildArchitecture: x64
- task: VSBuild@1
displayName: Build solution DirectXTK_GDK_2022 pcrel
continueOnError: True
inputs:
solution: DirectXTK_GDK_2022.sln
vsVersion: 17.0
platform: Gaming.Desktop.x64
configuration: Release
msbuildArchitecture: x64

- job: BUILD_GDK_CMAKE
displayName: 'Microsoft Game Development Kit (GDK) using CMake'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
inputs:
versionSpec: '6.5.x'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)\GDK
- task: CmdLine@2
displayName: Setup BWOI for GDK command-line
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\HostX64\x64
call $(Build.SourcesDirectory)\build\SetupBWOI.cmd $(EXTRACTED_FOLDER)\GDK $(GDK_EDITION) PC
echo ##vso[task.setvariable variable=GameDKLatest;]%GameDKLatest%
echo ##vso[task.setvariable variable=GRDKLatest;]%GRDKLatest%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
echo ##vso[task.prependpath]%ADDBIN%
failOnStderr: true
- task: CMake@1
displayName: 'CMake (MSVC): Config Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-GDK
- task: CMake@1
displayName: 'CMake (MSVC): Build Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-GDK
- task: CMake@1
displayName: 'CMake (MSVC): Config Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-GDK
- task: CMake@1
displayName: 'CMake (MSVC): Build Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Release-GDK
- task: CMake@1
displayName: 'CMake (Clang): Config Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-GDK-Clang
- task: CMake@1
displayName: 'CMake (Clang): Build Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-GDK-Clang
- task: CMake@1
displayName: 'CMake (Clang): Config Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-GDK-Clang
- task: CMake@1
displayName: 'CMake (Clang): Build Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Release-GDK-Clang
42 changes: 32 additions & 10 deletions build/DirectXTK-GitHub-GDK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ trigger:
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.ps1
Expand All @@ -40,6 +41,7 @@ pr:
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.ps1
Expand Down Expand Up @@ -77,17 +79,27 @@ jobs:
displayName: 'Use NuGet'
inputs:
versionSpec: '6.5.x'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: NuGetCommand@2
displayName: 'Set nuget.config to single source'
inputs:
command: custom
arguments: sources remove -Name nuget.org -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetCommand@2
Expand Down Expand Up @@ -142,16 +154,26 @@ jobs:
displayName: 'Use NuGet'
inputs:
versionSpec: '6.5.x'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: NuGetCommand@2
displayName: 'Set nuget.config to single source'
inputs:
command: custom
arguments: sources remove -Name nuget.org -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetCommand@2
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-MinGW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
Expand All @@ -35,6 +36,7 @@ pr:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
Expand Down
Loading

0 comments on commit 44d4a41

Please sign in to comment.