Skip to content

Commit

Permalink
CMake updated to build ARM64EC (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Jul 18, 2024
1 parent f01d5be commit 1877bba
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 4 deletions.
11 changes: 11 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
"cacheVariables": { "DIRECTX_ARCH": "arm64" },
"hidden": true
},
{
"name": "ARM64EC",
"architecture": {
"value": "arm64ec",
"strategy": "external"
},
"cacheVariables": { "DIRECTX_ARCH": "arm64ec" },
"hidden": true
},

{
"name": "Debug",
Expand Down Expand Up @@ -209,6 +218,8 @@
{ "name": "x86-Release-Win10" , "description": "MSVC for x86 (Release) for Windows 10", "inherits": [ "base", "x86", "Release", "MSVC", "Win10" ] },
{ "name": "arm64-Debug-Win10" , "description": "MSVC for ARM64 (Debug) for Windows 10", "inherits": [ "base", "ARM64", "Debug", "MSVC", "Win10" ] },
{ "name": "arm64-Release-Win10", "description": "MSVC for ARM64 (Release) for Windows 10", "inherits": [ "base", "ARM64", "Release", "MSVC", "Win10" ] },
{ "name": "arm64ec-Debug-Win10" , "description": "MSVC for ARM64EC (Debug) for Windows 10", "inherits": [ "base", "ARM64EC", "Debug", "MSVC", "Win10" ], "environment": { "CXXFLAGS": "/arm64EC" } },
{ "name": "arm64ec-Release-Win10", "description": "MSVC for ARM64EC (Release) for Windows 10", "inherits": [ "base", "ARM64EC", "Release", "MSVC", "Win10" ], "environment": { "CXXFLAGS": "/arm64EC" } },

{ "name": "x64-Debug-UWP" , "description": "MSVC for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "MSVC", "UWP" ] },
{ "name": "x64-Release-UWP" , "description": "MSVC for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "MSVC", "UWP" ] },
Expand Down
88 changes: 84 additions & 4 deletions build/DirectXTK-GitHub-Test-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ jobs:
configuration: Debug
msbuildArchitecture: x64

- job: CMAKE_BUILD
displayName: 'CMake BUILD_TESTING=ON'
- job: CMAKE_BUILD_X64
displayName: 'CMake for X64 BUILD_TESTING=ON'
timeoutInMinutes: 60
workspace:
clean: all
Expand Down Expand Up @@ -320,16 +320,70 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Release-Clang -v

- job: CMAKE_BUILD_ARM64
displayName: 'CMake for ARM64 BUILD_TESTING=ON'
timeoutInMinutes: 60
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
- task: DeleteFiles@1
displayName: Delete files from Tests
inputs:
Contents: 'out'
SourceFolder: Tests
Contents: '**'
RemoveSourceFolder: true
RemoveDotFiles: true
- task: CmdLine@2
displayName: Fetch Tests
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtktest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- task: CmdLine@2
displayName: Switch compiler to ARM64
displayName: Setup environment for CMake to use VS
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvarsamd64_arm64.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\arm64
echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
- task: CMake@1
displayName: CMake (MSVC; arm64-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64-Debug-Win10
- task: CMake@1
displayName: CMake (MSVC; arm64-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64-Debug-Win10 -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; arm64-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64-Release-Win10
- task: CMake@1
displayName: CMake (MSVC; arm64-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64-Release-Win10 -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; arm64-Debug) Config
inputs:
Expand All @@ -353,3 +407,29 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64-Release-Win10-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; arm64ec-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64ec-Debug-Win10
- task: CMake@1
displayName: CMake (MSVC; arm64ec-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64ec-Debug-Win10 -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; arm64ec-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64ec-Release-Win10
- task: CMake@1
displayName: CMake (MSVC; arm64ec-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64ec-Release-Win10 -v

0 comments on commit 1877bba

Please sign in to comment.