Skip to content

Commit

Permalink
ADO pipeline changes for OpenSSF Best Practices (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored May 17, 2024
1 parent 5094d26 commit 03afb33
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 136 deletions.
2 changes: 1 addition & 1 deletion Audio/AudioEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ X3DAUDIO_HANDLE& AudioEngine::Get3DHandle() const noexcept
#ifdef _MSC_VER
#pragma comment(lib,"runtimeobject.lib")
#pragma warning(push)
#pragma warning(disable: 4471 5204 5256)
#pragma warning(disable: 4471 5204 5256 6553)
#endif
#ifdef __clang__
#pragma clang diagnostic ignored "-Wnonportable-system-include-path"
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(ENABLE_CODE_ANALYSIS)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /analyze)
target_compile_options(${t} PRIVATE /analyze /WX)
endforeach()
endif()

Expand Down
2 changes: 1 addition & 1 deletion DirectXTK_Windows10_2022.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ For the latest version of DirectXTK, bug reports, etc. please visit the project

## Release Notes

FOR SECURITY ADVISORIES, see [GitHub](https://github.com/microsoft/DirectXTK/security/advisories).

For a full change history, see [CHANGELOG.md](https://github.com/microsoft/DirectXTK/blob/main/CHANGELOG.md).

* Starting with the February 2023 release, the Mouse class implementation of relative mouse movement was updated to accumulate changes between calls to ``GetState``. By default, each time you call ``GetState`` the deltas are reset which works for scenarios where you use relative movement but only call the method once per frame. If you call it more than once per frame, then add an explicit call to ``EndOfInputFrame`` to use an explicit reset model instead.

* As of the September 2022 release, the library makes use of C++11 inline namespaces for differing types that have the same names in the DirectX 11 and DirectX 12 version of the *DirectX Tool Kit*. This provides a link-unique name such as ``DirectX::DX11::SpriteBatch`` that will appear in linker output messages. In most use cases, however, there is no need to add explicit ``DX11`` namespace resolution in client code.
Expand Down Expand Up @@ -108,6 +112,8 @@ This project welcomes contributions and suggestions. Most contributions require

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

Tests for new features should also be submitted as a PR to the [Test Suite](https://github.com/walbourn/directxtktest/wiki) repository.

## Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
Expand Down
31 changes: 6 additions & 25 deletions Src/DDSTextureLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,22 +895,13 @@ namespace
if (texture || textureView)
{
#if defined(_XBOX_ONE) && defined(_TITLE)
const wchar_t* pstrName = wcsrchr(fileName, '\\');
if (!pstrName)
{
pstrName = fileName;
}
else
{
pstrName++;
}
if (texture && *texture)
{
(*texture)->SetName(pstrName);
(*texture)->SetName(fileName);
}
if (textureView && *textureView)
{
(*textureView)->SetName(pstrName);
(*textureView)->SetName(fileName);
}
#else
CHAR strFileA[MAX_PATH];
Expand All @@ -925,29 +916,19 @@ namespace
);
if (result > 0)
{
const char* pstrName = strrchr(strFileA, '\\');
if (!pstrName)
{
pstrName = strFileA;
}
else
{
pstrName++;
}

if (texture && *texture)
{
(*texture)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}

if (textureView && *textureView)
{
(*textureView)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Src/GamePad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ bool GamePad::GetDevice(int player, _Outptr_ IGameInputDevice * *device) noexcep

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4471 5204 5256)
#pragma warning(disable : 4471 5204 5256 6553)
#endif
#include <windows.gaming.input.h>
#ifdef _MSC_VER
Expand Down
31 changes: 6 additions & 25 deletions Src/WICTextureLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,22 +754,13 @@ namespace
if (texture || textureView)
{
#if defined(_XBOX_ONE) && defined(_TITLE)
const wchar_t* pstrName = wcsrchr(fileName, '\\');
if (!pstrName)
{
pstrName = fileName;
}
else
{
pstrName++;
}
if (texture && *texture)
{
(*texture)->SetName(pstrName);
(*texture)->SetName(fileName);
}
if (textureView && *textureView)
{
(*textureView)->SetName(pstrName);
(*textureView)->SetName(fileName);
}
#else
CHAR strFileA[MAX_PATH];
Expand All @@ -784,29 +775,19 @@ namespace
);
if (result > 0)
{
const char* pstrName = strrchr(strFileA, '\\');
if (!pstrName)
{
pstrName = strFileA;
}
else
{
pstrName++;
}

if (texture && *texture)
{
(*texture)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}

if (textureView && *textureView)
{
(*textureView)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Src/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
#endif

#pragma warning(push)
#pragma warning(disable : 4467 4986 5038 5204 5220)
#pragma warning(disable : 4467 4986 5038 5204 5220 6101)
#ifdef __MINGW32__
#include <wrl/client.h>
#else
Expand Down
34 changes: 30 additions & 4 deletions build/DirectXTK-GitHub-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,48 @@ schedules:
include:
- main

trigger: none
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets

pr:
branches:
include:
- main
paths:
include:
- build/DirectXTK-GitHub-Dev17.yml
exclude:
- '*.md'
- LICENSE
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
drafts: false

resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
trigger: none

name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

Expand Down
22 changes: 6 additions & 16 deletions build/DirectXTK-GitHub-Test-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pool:

variables:
Codeql.Enabled: false
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
GUID_FEED: $(ADOFeedGUID)

Expand Down Expand Up @@ -255,20 +256,13 @@ jobs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtktest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- task: ChocolateyCommand@0
displayName: Install Ninja
inputs:
command: 'install'
installPackageId: 'ninja'
- task: CmdLine@2
displayName: Setup environment for CMake to use VS
inputs:
script: |
@echo off
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
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
Expand Down Expand Up @@ -330,14 +324,10 @@ jobs:
inputs:
Contents: 'out'
- task: CmdLine@2
displayName: Set LIB for ARM64
displayName: Switch compiler to ARM64
inputs:
script: |
@echo off
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" arm64
call "$(VC_PATH)\Auxiliary\Build\vcvarsamd64_arm64.bat"
echo ##vso[task.setvariable variable=LIB;]%LIB%
- task: CMake@1
Expand Down
63 changes: 3 additions & 60 deletions build/DirectXTK-GitHub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ resources:

name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

pool:
vmImage: windows-2019

variables:
Codeql.Enabled: false
GUID_FEED: $(ADOFeedGUID)

pool:
vmImage: windows-2022

jobs:
- job: DESKTOP_BUILD
displayName: 'Win32 Desktop'
Expand Down Expand Up @@ -199,60 +199,3 @@ jobs:
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Release

- job: UWP_BUILD
displayName: 'Universal Windows Platform (UWP)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln 32dbg
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x86
configuration: Debug
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln 32rel
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x86
configuration: Release
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln 64dbg
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x64
configuration: Debug
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln 64rel
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x64
configuration: Release
- task: CmdLine@2
displayName: 'Reclaim diskspace'
inputs:
script: del *.pch /s
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: false
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln arm64dbg
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Debug
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln arm64rel
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Release
Loading

0 comments on commit 03afb33

Please sign in to comment.