Skip to content

Commit

Permalink
ci(build): try switch to MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Dec 26, 2023
1 parent 5f94923 commit 6b5669a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 cmake mingw-w64-x86_64-ninja'
- 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 Ninja -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'
5 changes: 5 additions & 0 deletions support/BuildSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6b5669a

Please sign in to comment.