Skip to content

Commit

Permalink
CMake update for try-compile with DLLs (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Mar 8, 2025
1 parent 72a2c29 commit cf4da26
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 30 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/uwp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,15 @@ jobs:
- name: 'Build'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\${{ matrix.build_type }}

- name: 'Clean up'
working-directory: ${{ github.workspace }}
run: Remove-Item -Path out -Recurse -Force

- name: 'Configure CMake (DLL)'
working-directory: ${{ github.workspace }}
run: cmake --preset=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=ON

- name: 'Build (DLL)'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\${{ matrix.build_type }}
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ cmake_minimum_required (VERSION 3.20)

set(DIRECTXTK12_VERSION 1.6.1)

if(WINDOWS_STORE OR (DEFINED XBOX_CONSOLE_TARGET))
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
endif()

project (DirectXTK12
VERSION ${DIRECTXTK12_VERSION}
DESCRIPTION "DirectX Tool Kit for DirectX 12"
Expand Down
72 changes: 56 additions & 16 deletions build/DirectXTK12-GitHub-CMake-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ jobs:
displayName: 'CMake (MSVC): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug'
inputs:
Expand All @@ -97,7 +99,9 @@ jobs:
displayName: 'CMake (MSVC): Config x86'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A Win32 -B out2 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A Win32 -B out2
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (MSVC): Build x86 Debug'
inputs:
Expand All @@ -112,7 +116,9 @@ jobs:
displayName: 'CMake (MSVC): Config ARM64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A ARM64 -B out3 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A ARM64 -B out3
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (MSVC): Build ARM64 Debug'
inputs:
Expand All @@ -127,7 +133,9 @@ jobs:
displayName: 'CMake (UWP): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out4 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=10.0'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out4
-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=10.0
- task: CMake@1
displayName: 'CMake (UWP): Build x64'
inputs:
Expand All @@ -137,64 +145,96 @@ jobs:
displayName: 'CMake (ClangCl): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out6 -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out5
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out6 -v --config Debug
cmakeArgs: --build out5 -v --config Debug
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out6 -v --config RelWithDebInfo
cmakeArgs: --build out5 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (ClangCl): Config ARM64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A ARM64 -T clangcl -B out7 -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A ARM64 -T clangcl -B out6
-DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)
- task: CMake@1
displayName: 'CMake (ClangCl): Build ARM64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out7 -v --config Debug
cmakeArgs: --build out6 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out8 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out7
-DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build x64 Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out8 -v --config Debug
cmakeArgs: --build out7 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build x64 Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out8 -v --config RelWithDebInfo
cmakeArgs: --build out7 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Config ARM64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A ARM64 -B out9 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A ARM64 -B out8
-DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build ARM64 Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out9 -v --config Debug
cmakeArgs: --build out8 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build ARM64 Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out9 -v --config RelWithDebInfo
cmakeArgs: --build out8 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (NO_WCHAR_T): Config'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out10 -DNO_WCHAR_T=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out9
-DNO_WCHAR_T=ON
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)
- task: CMake@1
displayName: 'CMake (NO_WCHAR_T): Build'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out9 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out10
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out10 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out10 -v --config RelWithDebInfo
44 changes: 38 additions & 6 deletions build/DirectXTK12-GitHub-CMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ jobs:
displayName: 'CMake (MSVC): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug'
inputs:
Expand All @@ -90,7 +92,9 @@ jobs:
displayName: 'CMake (MSVC): Config x86'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A Win32 -B out2 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A Win32 -B out2
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (MSVC): Build x86 Debug'
inputs:
Expand All @@ -105,7 +109,9 @@ jobs:
displayName: 'CMake (UWP): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out3 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=10.0'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out3
-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=10.0
- task: CMake@1
displayName: 'CMake (UWP): Build x64'
inputs:
Expand All @@ -115,7 +121,9 @@ jobs:
displayName: 'CMake (ClangCl): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out4 -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out4
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Debug'
inputs:
Expand All @@ -130,7 +138,10 @@ jobs:
displayName: 'CMake (MSVC Spectre): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out5 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out5
-DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build x64 Debug'
inputs:
Expand All @@ -145,9 +156,30 @@ jobs:
displayName: 'CMake (NO_WCHAR_T): Config'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out6 -DNO_WCHAR_T=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out6
-DNO_WCHAR_T=ON
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)
- task: CMake@1
displayName: 'CMake (NO_WCHAR_T): Build'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out6 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out7
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out7 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out7 -v --config RelWithDebInfo
8 changes: 4 additions & 4 deletions build/DirectXTK12-GitHub-GDK-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ jobs:
inputs:
Contents: 'out/build'
- task: CMake@1
displayName: 'CMake (MSVC, DLL): Config Scarlett Debug'
displayName: 'CMake (DLL): Config Scarlett Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-Scarlett -DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (MSVC, DLL): Build Scarlett Debug'
displayName: 'CMake (DLL): Build Scarlett Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-Scarlett
Expand Down Expand Up @@ -390,12 +390,12 @@ jobs:
inputs:
Contents: 'out/build'
- task: CMake@1
displayName: 'CMake (MSVC, DLL): Config XboxOne Debug'
displayName: 'CMake (DLL): Config XboxOne Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-XboxOne -DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (MSVC, DLL): Build XboxOne Debug'
displayName: 'CMake (DLL): Build XboxOne Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-XboxOne

0 comments on commit cf4da26

Please sign in to comment.