Skip to content

Commit 61124d3

Browse files
committed
Support building on msys/clang64
1 parent 639c676 commit 61124d3

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

.github/workflows/main.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
matrix:
194194
# Build each combination of OS and release/debug variants
195195
os: [ windows-2019 ]
196-
msystem: [ ucrt64, mingw64 ]
196+
msystem: [ ucrt64, mingw64, clang64 ]
197197
build-type: [ Release, Debug ]
198198
include:
199199
- msystem: ucrt64
@@ -202,6 +202,9 @@ jobs:
202202
- msystem: mingw64
203203
package-prefix: x86_64
204204
cmake-flags: LDFLAGS="-fuse-ld=lld -lstdc++ -lgcc_s"
205+
- msystem: clang64
206+
package-prefix: clang-x86_64
207+
cmake-flags: LDFLAGS="-lc++"
205208
# Don't abort runners if a single one fails
206209
fail-fast: false
207210
runs-on: ${{ matrix.os }}
@@ -220,7 +223,7 @@ jobs:
220223
run: |
221224
mkdir build
222225
cd build
223-
${{ matrix.cmake-flags }} cmake .. -DTESTS=ON -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
226+
${{ matrix.cmake-flags }} cmake .. -DTESTS=ON -DCMAKE_C_COMPILER="$MINGW_PREFIX/bin/clang" -DCMAKE_CXX_COMPILER="$MINGW_PREFIX/bin/clang++" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
224227
- name: Build
225228
working-directory: build
226229
run: |
@@ -229,7 +232,14 @@ jobs:
229232
working-directory: build
230233
run: |
231234
ctest -j 4 --output-on-failure -T test
232-
235+
- name: Install
236+
working-directory: build
237+
run: |
238+
cmake --install . --prefix=../dist
239+
- uses: actions/upload-artifact@v4
240+
with:
241+
name: ${{ matrix.msystem }}-${{ matrix.build-type }}
242+
path: dist/
233243

234244
# Fake check that can be used as a branch-protection rule.
235245
all-checks:

CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ endif()
2020

2121
enable_language(OBJC OBJCXX)
2222

23+
if (MINGW)
24+
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
25+
set(CMAKE_LINK_LIBRARY_SUFFIX "")
26+
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
27+
set(CMAKE_OBJCXX_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
28+
endif ()
29+
2330
INCLUDE (CheckCXXSourceCompiles)
2431
INCLUDE (FetchContent)
2532

@@ -301,6 +308,9 @@ if (NOT CMAKE_INSTALL_LIBDIR)
301308
set(CMAKE_INSTALL_LIBDIR lib)
302309
endif ()
303310

311+
if (NOT CMAKE_INSTALL_BINDIR)
312+
set(CMAKE_INSTALL_BINDIR bin)
313+
endif ()
304314

305315
set(GNUSTEP_INSTALL_TYPE ${DEFAULT_INSTALL_TYPE} CACHE STRING
306316
"GNUstep installation type. Options are NONE, SYSTEM, NETWORK or LOCAL.")

0 commit comments

Comments
 (0)