|
| 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 | + |
| 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 | + |
| 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