Skip to content

Commit 68cab7e

Browse files
committed
Windows builds
1 parent 67c2079 commit 68cab7e

3 files changed

Lines changed: 74 additions & 51 deletions

File tree

.github/workflows/CI.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,30 @@ on: [push, pull_request]
55
jobs:
66
build:
77
name: Build & Test
8-
runs-on: ubuntu-24.04
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [ubuntu-24.04, windows-2025]
12+
include:
13+
- os: ubuntu-24.04
14+
configure: cmake -DCMAKE_BUILD_TYPE=Debug -Bbuild
15+
build: cmake --build build -j
16+
artifact_name: afs-debug-x86_64-linux
17+
artifacts: |
18+
build/libafs.a
19+
build/afstest
20+
build/assemblytool
21+
- os: windows-2025
22+
configure: cmake -Bbuild
23+
build: cmake --build build -j
24+
artifact_name: afs-debug-x86_64-win32
25+
artifacts: build/Debug/*
26+
27+
runs-on: ${{ matrix.os }}
928

1029
steps:
1130
- name: Install dependencies
31+
if: ${{ matrix.os == 'ubuntu-24.04' }}
1232
run: |
1333
sudo apt-get update
1434
sudo apt-get -y install check doxygen
@@ -20,16 +40,16 @@ jobs:
2040
submodules: "recursive"
2141

2242
- name: Configure
23-
run: cmake -DCMAKE_BUILD_TYPE=Debug -Bbuild
43+
run: ${{ matrix.configure }}
2444

2545
- name: Build
26-
run: cmake --build build -j
46+
run: ${{ matrix.build }}
2747

28-
- name: Upload libafs
48+
- name: Upload binaries
2949
uses: actions/upload-artifact@v4
3050
with:
31-
name: libafs
32-
path: build/libafs.a
51+
name: ${{ matrix.artifact_name }}
52+
path: ${{ matrix.artifacts }}
3353

3454
- name: Upload tool binaries
3555
uses: actions/upload-artifact@v4
@@ -40,6 +60,7 @@ jobs:
4060
build/assemblytool
4161
4262
- name: Test
63+
if: ${{ matrix.os == 'ubuntu-24.04' }}
4364
working-directory: ./build
4465
run: ./afstest
4566

CMakeLists.txt

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ project(afs C)
44

55
add_subdirectory(unboxing EXCLUDE_FROM_ALL)
66

7-
set(WARNINGS -Wall -Wextra -Wpedantic -pedantic-errors -Wformat-overflow=1 -Wstrict-overflow=2 -Werror)
7+
if(WIN32)
8+
set(WARNINGS /MP)
9+
else()
10+
set(WARNINGS -Wall -Wextra -Wpedantic -pedantic-errors -Wformat-overflow=1 -Wstrict-overflow=2 -Werror)
11+
endif()
812

913
add_library(minixml
1014
thirdparty/minixml/src/mxml-attr.c
@@ -70,34 +74,46 @@ endif()
7074
if(BUILD_TESTING)
7175
enable_testing()
7276

73-
add_executable(afstest
74-
tests/afs/controldatatests.c
75-
tests/afs/controlframetests.c
76-
tests/afs/framerangestests.c
77-
tests/afs/framerangetests.c
78-
tests/afs/main.c
79-
tests/afs/previewtests.c
80-
tests/afs/sha1tests.c
81-
tests/afs/sha256tests.c
82-
tests/afs/tocdatafilemetadatasourcetests.c
83-
tests/afs/tocdatafilemetadatatests.c
84-
tests/afs/tocdatareelstests.c
85-
tests/afs/tocdatareeltests.c
86-
tests/afs/tocdatatests.c
87-
tests/afs/tocfilepreviewpagetests.c
88-
tests/afs/tocfilepreviewtests.c
89-
tests/afs/tocfilestests.c
90-
tests/afs/tocfiletests.c
91-
tests/afs/tocmetadatasourcetests.c
92-
tests/afs/tocmetadatatests.c
93-
tests/afs/tocpreviewlayoutdefinitionstests.c
94-
tests/afs/tocpreviewlayoutdefinitiontests.c
95-
tests/afs/tocpreviewsectionstests.c
96-
tests/afs/tocpreviewsectiontests.c
97-
tests/afs/zeroreferenceframetests.c
98-
)
99-
target_compile_options(afstest PRIVATE ${WARNINGS})
100-
target_link_libraries(afstest afs testutils check subunit)
77+
if(NOT WIN32)
78+
add_executable(afstest
79+
tests/afs/controldatatests.c
80+
tests/afs/controlframetests.c
81+
tests/afs/framerangestests.c
82+
tests/afs/framerangetests.c
83+
tests/afs/main.c
84+
tests/afs/previewtests.c
85+
tests/afs/sha1tests.c
86+
tests/afs/sha256tests.c
87+
tests/afs/tocdatafilemetadatasourcetests.c
88+
tests/afs/tocdatafilemetadatatests.c
89+
tests/afs/tocdatareelstests.c
90+
tests/afs/tocdatareeltests.c
91+
tests/afs/tocdatatests.c
92+
tests/afs/tocfilepreviewpagetests.c
93+
tests/afs/tocfilepreviewtests.c
94+
tests/afs/tocfilestests.c
95+
tests/afs/tocfiletests.c
96+
tests/afs/tocmetadatasourcetests.c
97+
tests/afs/tocmetadatatests.c
98+
tests/afs/tocpreviewlayoutdefinitionstests.c
99+
tests/afs/tocpreviewlayoutdefinitiontests.c
100+
tests/afs/tocpreviewsectionstests.c
101+
tests/afs/tocpreviewsectiontests.c
102+
tests/afs/zeroreferenceframetests.c
103+
)
104+
target_compile_options(afstest PRIVATE ${WARNINGS})
105+
target_link_libraries(afstest afs testutils check subunit)
106+
add_test(NAME afstest COMMAND afstest)
107+
set_target_properties(afstest PROPERTIES C_EXTENSIONS OFF C_STANDARD 99 C_STANDARD_REQUIRED ON)
108+
109+
add_custom_command(
110+
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/doc/html/index.html"
111+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
112+
COMMAND doxygen doxygen.dox
113+
DEPENDS doxygen.dox
114+
)
115+
add_custom_target(doxygen ALL DEPENDS doc/html/index.html)
116+
endif()
101117

102118
add_executable(assemblytool
103119
tests/assemblytool/main.c
@@ -107,19 +123,5 @@ if(BUILD_TESTING)
107123
target_include_directories(assemblytool PRIVATE inc)
108124
target_link_libraries(assemblytool afs testutils)
109125

110-
set_target_properties(afstest assemblytool PROPERTIES
111-
C_EXTENSIONS OFF
112-
C_STANDARD 99
113-
C_STANDARD_REQUIRED ON
114-
)
115-
116-
add_test(NAME afstest COMMAND afstest)
117-
118-
add_custom_command(
119-
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/doc/html/index.html"
120-
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
121-
COMMAND doxygen doxygen.dox
122-
DEPENDS doxygen.dox
123-
)
124-
add_custom_target(doxygen ALL DEPENDS doc/html/index.html)
126+
set_target_properties(assemblytool PROPERTIES C_EXTENSIONS OFF C_STANDARD 99 C_STANDARD_REQUIRED ON)
125127
endif()

0 commit comments

Comments
 (0)