From 7cbe5742c8520e7174bd1e604618eed32fb25208 Mon Sep 17 00:00:00 2001 From: JustDoom <61824552+JustDoom@users.noreply.github.com> Date: Sat, 19 Oct 2024 18:28:53 +1000 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca7fde1..c3d312b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,11 +63,20 @@ jobs: ssh-keyscan github.com >> ~/.ssh/known_hosts git submodule update --init --recursive + - name: Create MinGW Toolchain File + run: | + echo "set(CMAKE_SYSTEM_NAME Windows)" > mingw-toolchain.cmake + echo "set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)" >> mingw-toolchain.cmake + echo "set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)" >> mingw-toolchain.cmake + echo "set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)" >> mingw-toolchain.cmake + echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> mingw-toolchain.cmake + echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> mingw-toolchain.cmake + echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> mingw-toolchain.cmake + - name: Configure and build for Windows run: | mkdir build && cd build - # Set MinGW as the compiler directly - cmake -G Ninja -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ .. + cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=../mingw-toolchain.cmake .. cmake --build . --config Release - name: Upload executable