diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9883331..d1aeb7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,18 +58,27 @@ jobs: path: 'build/libzenkitcapi*' windows: name: "Windows" - runs-on: 'windows-2019' + runs-on: 'windows-latest' + defaults: + run: + shell: 'msys2 {0}' steps: - uses: 'actions/checkout@v3' with: submodules: 'recursive' + - name: 'Install MinGW' + uses: 'msys2/setup-msys2@v2' + with: + msystem: 'UCRT64' + update: true + install: 'git mingw-w64-ucrt-x86_64-gcc' - name: 'Configure' shell: 'bash' - run: 'cmake -B build -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DZK_BUILD_EXAMPLES=ON -DZK_BUILD_TESTS=ON' + run: 'cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DZK_BUILD_EXAMPLES=OFF -DZK_BUILD_TESTS=OFF' - name: 'Build' run: 'cmake --build build --config Release -j 2' - name: 'Publish Library' uses: 'actions/upload-artifact@v3' with: name: 'Windows x86-64 DLL' - path: 'build/Release/*' + path: 'build/*.dll' diff --git a/support/BuildSupport.cmake b/support/BuildSupport.cmake index 04590d7..71b2165 100644 --- a/support/BuildSupport.cmake +++ b/support/BuildSupport.cmake @@ -15,6 +15,11 @@ function(bs_select_cflags SANITIZERS COMPILE LINK) bs_internal_select_cflags_gcc(${SANITIZERS} _INTERNAL_COMPILE_FLAGS _INTERNAL_LINK_FLAGS) endif() + if (MINGW) + list(APPEND _INTERNAL_COMPILE_FLAGS "-static") + list(APPEND _INTERNAL_LINK_FLAGS "-static") + endif() + # return _INTERNAL_COMPILE_FLAGS, _INTERNAL_LINK_FLAGS; set(${COMPILE} ${_INTERNAL_COMPILE_FLAGS} PARENT_SCOPE) set(${LINK} ${_INTERNAL_LINK_FLAGS} PARENT_SCOPE)