Skip to content

Commit d165629

Browse files
committed
2 parents 07b119f + deb1759 commit d165629

File tree

2 files changed

+162
-15
lines changed

2 files changed

+162
-15
lines changed

.github/workflows/cmake-directxtex.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,20 @@ jobs:
4646
run: |
4747
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
4848
49-
- name: Install vcpkg
49+
- name: Install vcpkg (Other)
50+
if: matrix.os != 'windows-latest'
5051
run: |
5152
cd DirectXTex/DirectXTex
5253
git clone https://github.com/microsoft/vcpkg.git
5354
./vcpkg/bootstrap-vcpkg.sh
5455
56+
- name: Install vcpkg (Windows)
57+
if: matrix.os == 'windows-latest'
58+
run: |
59+
cd DirectXTex/DirectXTex
60+
git clone https://github.com/microsoft/vcpkg.git
61+
./vcpkg/bootstrap-vcpkg.bat
62+
5563
- name: Install DirectX 12 headers and DirectXMath
5664
if: matrix.os != 'windows-latest'
5765
run: |
@@ -68,41 +76,51 @@ jobs:
6876
if: matrix.arch == 'x86_64' && matrix.os == 'windows-latest'
6977
run: |
7078
cd DirectXTex/DirectXTex
71-
& .\vcpkg\vcpkg.exe install directx-headers:x64-windows --allow-unsupported
72-
& .\vcpkg\vcpkg.exe install directxmath:x64-windows --allow-unsupported
73-
& .\vcpkg\vcpkg.exe install libpng:x64-windows
74-
& .\vcpkg\vcpkg.exe install libjpeg:x64-windows
75-
& .\vcpkg\vcpkg.exe install openexr:x64-windows
79+
./vcpkg/vcpkg.exe install directx-headers:x64-windows --allow-unsupported
80+
./vcpkg/vcpkg.exe install directxmath:x64-windows --allow-unsupported
81+
./vcpkg/vcpkg.exe install libpng:x64-windows
82+
./vcpkg/vcpkg.exe install libjpeg:x64-windows
83+
./vcpkg/vcpkg.exe install openexr:x64-windows
7684
env:
7785
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
7886

7987
- name: Install DirectX 12 headers and DirectXMath on Windows x86
80-
if: matrix.arch == 'x86' && matrix.os == 'windows-latest'
88+
if: matrix.os == 'windows-latest' && matrix.arch == 'x86'
89+
run: |
90+
cd DirectXTex/DirectXTex
91+
./vcpkg/vcpkg.exe install directx-headers:x86-windows --allow-unsupported
92+
./vcpkg/vcpkg.exe install directxmath:x86-windows --allow-unsupported
93+
./vcpkg/vcpkg.exe install libpng:x86-windows
94+
./vcpkg/vcpkg.exe install libjpeg:x86-windows
95+
./vcpkg/vcpkg.exe install openexr:x86-windows
96+
97+
- name: Install DirectX 12 headers and DirectXMath on Windows x86
98+
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64'
8199
run: |
82100
cd DirectXTex/DirectXTex
83-
& .\vcpkg\vcpkg.exe install directx-headers:x86-windows --allow-unsupported
84-
& .\vcpkg\vcpkg.exe install directxmath:x86-windows --allow-unsupported
85-
& .\vcpkg\vcpkg.exe install libpng:x86-windows
86-
& .\vcpkg\vcpkg.exe install libjpeg:x86-windows
87-
& .\vcpkg\vcpkg.exe install openexr:x86-windows
101+
./vcpkg/vcpkg.exe install directx-headers:arm64-windows --allow-unsupported
102+
./vcpkg/vcpkg.exe install directxmath:arm64-windows --allow-unsupported
103+
./vcpkg/vcpkg.exe install libpng:arm64-windows
104+
./vcpkg/vcpkg.exe install libjpeg:arm64-windows
105+
./vcpkg/vcpkg.exe install openexr:arm64-windows
88106
89107
- name: Configure DirectXTex with CMake for macOS ARM64
90108
if: matrix.arch == 'arm64' && matrix.os == 'macos-latest'
91109
run: |
92110
cd DirectXTex/DirectXTex
93-
cmake -S . -B ./build -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_DX12=OFF -DENABLE_DX11=OFF
111+
cmake -S . -B ./build -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_DX12=OFF -DENABLE_DX11=OFF
94112
95113
- name: Configure DirectXTex with CMake for macOS
96114
if: matrix.arch != 'arm64' && matrix.os == 'macos-latest'
97115
run: |
98116
cd DirectXTex/DirectXTex
99-
cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_DX12=OFF -DENABLE_DX11=OFF
117+
cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_DX12=OFF -DENABLE_DX11=OFF
100118
101119
- name: Configure DirectXTex with CMake
102120
if: matrix.os != 'macos-latest'
103121
run: |
104122
cd DirectXTex/DirectXTex
105-
cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
123+
cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
106124
107125
- name: Build DirectXTex
108126
run: cmake --build DirectXTex/DirectXTex/build --config Release

.github/workflows/win-cmake.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Build DirectXTex Libraries (Win)
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
include:
11+
- os: windows-latest
12+
arch: x86_64
13+
# - os: windows-latest
14+
# arch: x86
15+
# - os: windows-latest
16+
# arch: arm64
17+
steps:
18+
- uses: actions/[email protected]
19+
with:
20+
repository: 'HexaEngine/Hexa.NET.DirectXTex'
21+
path: 'DirectXTex'
22+
submodules: true
23+
24+
- name: Install dependencies on Ubuntu
25+
if: matrix.os == 'ubuntu-latest'
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y build-essential cmake
29+
30+
- name: Install dependencies on macOS
31+
if: matrix.os == 'macos-latest'
32+
run: |
33+
brew update
34+
brew install cmake
35+
36+
- name: Install dependencies on Windows
37+
if: matrix.os == 'windows-latest'
38+
run: |
39+
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
40+
41+
- name: Install vcpkg (Other)
42+
if: matrix.os != 'windows-latest'
43+
run: |
44+
cd DirectXTex/DirectXTex
45+
git clone https://github.com/microsoft/vcpkg.git
46+
./vcpkg/bootstrap-vcpkg.sh
47+
48+
- name: Install vcpkg (Windows)
49+
if: matrix.os == 'windows-latest'
50+
run: |
51+
cd DirectXTex/DirectXTex
52+
git clone https://github.com/microsoft/vcpkg.git
53+
./vcpkg/bootstrap-vcpkg.bat
54+
55+
- name: Install DirectX 12 headers and DirectXMath
56+
if: matrix.os != 'windows-latest'
57+
run: |
58+
cd DirectXTex/DirectXTex
59+
./vcpkg/vcpkg install directx-headers --allow-unsupported
60+
./vcpkg/vcpkg install directxmath --allow-unsupported
61+
./vcpkg/vcpkg install libpng
62+
./vcpkg/vcpkg install libjpeg-turbo
63+
./vcpkg/vcpkg install openexr
64+
env:
65+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
66+
67+
- name: Install DirectX 12 headers and DirectXMath on Windows x64
68+
if: matrix.arch == 'x86_64' && matrix.os == 'windows-latest'
69+
run: |
70+
cd DirectXTex/DirectXTex
71+
./vcpkg/vcpkg.exe install directx-headers:x64-windows --allow-unsupported
72+
./vcpkg/vcpkg.exe install directxmath:x64-windows --allow-unsupported
73+
./vcpkg/vcpkg.exe install libpng:x64-windows
74+
./vcpkg/vcpkg.exe install libjpeg:x64-windows
75+
./vcpkg/vcpkg.exe install openexr:x64-windows
76+
env:
77+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
78+
79+
- name: Install DirectX 12 headers and DirectXMath on Windows x86
80+
if: matrix.os == 'windows-latest' && matrix.arch == 'x86'
81+
run: |
82+
cd DirectXTex/DirectXTex
83+
./vcpkg/vcpkg.exe install directx-headers:x86-windows --allow-unsupported
84+
./vcpkg/vcpkg.exe install directxmath:x86-windows --allow-unsupported
85+
./vcpkg/vcpkg.exe install libpng:x86-windows
86+
./vcpkg/vcpkg.exe install libjpeg:x86-windows
87+
./vcpkg/vcpkg.exe install openexr:x86-windows
88+
89+
- name: Install DirectX 12 headers and DirectXMath on Windows x86
90+
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64'
91+
run: |
92+
cd DirectXTex/DirectXTex
93+
./vcpkg/vcpkg.exe install directx-headers:arm64-windows --allow-unsupported
94+
./vcpkg/vcpkg.exe install directxmath:arm64-windows --allow-unsupported
95+
./vcpkg/vcpkg.exe install libpng:arm64-windows
96+
./vcpkg/vcpkg.exe install libjpeg:arm64-windows
97+
./vcpkg/vcpkg.exe install openexr:arm64-windows
98+
99+
- name: Configure DirectXTex with CMake for macOS ARM64
100+
if: matrix.arch == 'arm64' && matrix.os == 'macos-latest'
101+
run: |
102+
cd DirectXTex/DirectXTex
103+
cmake -S . -B ./build -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_DX12=OFF -DENABLE_DX11=OFF
104+
105+
- name: Configure DirectXTex with CMake for macOS
106+
if: matrix.arch != 'arm64' && matrix.os == 'macos-latest'
107+
run: |
108+
cd DirectXTex/DirectXTex
109+
cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_DX12=OFF -DENABLE_DX11=OFF
110+
111+
- name: Configure DirectXTex with CMake
112+
if: matrix.os != 'macos-latest'
113+
run: |
114+
cd DirectXTex/DirectXTex
115+
cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/DirectXTex/DirectXTex/vcpkg/scripts/buildsystems/vcpkg.cmake"
116+
117+
- name: Build DirectXTex
118+
run: cmake --build DirectXTex/DirectXTex/build --config Release
119+
120+
- name: Upload Artifacts
121+
uses: actions/[email protected]
122+
with:
123+
name: ${{ matrix.os }}-${{ matrix.arch }}-artifacts
124+
path: |
125+
DirectXTex/DirectXTex/build/bin/Release/*.dll
126+
DirectXTex/DirectXTex/build/lib/*.so
127+
DirectXTex/DirectXTex/build/lib/*.dylib
128+
DirectXTex/DirectXTex/build/bin/CMake/*.dylib
129+
if-no-files-found: ignore # 'warn' or 'ignore' or 'error'

0 commit comments

Comments
 (0)