Skip to content

Commit ca9f3e6

Browse files
committed
[ci] Build the shared version
1 parent 99da25e commit ca9f3e6

1 file changed

Lines changed: 43 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ jobs:
77
fail-fast: false
88
matrix:
99
os: [windows-latest, macos-latest, ubuntu-latest]
10-
enable_image: [on, off]
10+
sanitize: [address, none]
11+
shared: [shared, static]
12+
enable_image: [with_image, text_only]
1113
steps:
1214
- uses: actions/checkout@v4
1315
- uses: ilammy/msvc-dev-cmd@v1
@@ -21,14 +23,39 @@ jobs:
2123
- name: Generating Makefiles
2224
shell: bash
2325
run: |
26+
if [[ "${{ matrix.shared }}" == "shared" ]] ; then
27+
shared=on
28+
else
29+
shared=off
30+
fi
31+
if [[ "${{ matrix.enable_image }}" == "with_image" ]] ; then
32+
with_image=on
33+
else
34+
with_image=off
35+
fi
2436
if [[ "${{ runner.os }}" == "Windows" ]] ; then
25-
cmake . -G "NMake Makefiles" \
26-
-DCLIP_ENABLE_IMAGE=${{ matrix.enable_image }} \
27-
"-DCMAKE_CXX_FLAGS:STRING=-DWIN32 -D_WINDOWS -GR -EHsc -fsanitize=address" \
28-
"-DCMAKE_EXE_LINKER_FLAGS:STRING=-machine:x64 -fsanitize=address"
37+
if [[ "${{ runner.sanitize }}" == "address" ]] ; then
38+
cmake . -G "NMake Makefiles" \
39+
-DCLIP_ENABLE_IMAGE=${{ matrix.enable_image }} \
40+
"-DCMAKE_CXX_FLAGS:STRING=-DWIN32 -D_WINDOWS -GR -EHsc -fsanitize=address" \
41+
"-DCMAKE_EXE_LINKER_FLAGS:STRING=-machine:x64 -fsanitize=address"
42+
else
43+
cmake . -G "NMake Makefiles" \
44+
-DCLIP_ENABLE_IMAGE=${{ matrix.enable_image }} \
45+
-DBUILD_SHARED_LIBS=$shared
46+
fi
2947
else
30-
cmake . -G "Unix Makefiles" \
31-
-DCLIP_ENABLE_IMAGE=${{ matrix.enable_image }}
48+
if [[ "${{ runner.sanitize }}" == "address" ]] ; then
49+
cmake . -G "Unix Makefiles" \
50+
-DCLIP_ENABLE_IMAGE=${{ matrix.enable_image }} \
51+
"-DCMAKE_CXX_FLAGS:STRING=-fsanitize=address" \
52+
"-DCMAKE_EXE_LINKER_FLAGS:STRING=-fsanitize=address" \
53+
-DBUILD_SHARED_LIBS=$shared
54+
else
55+
cmake . -G "Unix Makefiles" \
56+
"-DCLIP_ENABLE_IMAGE=$with_image" \
57+
-DBUILD_SHARED_LIBS=$shared
58+
fi
3259
fi
3360
- name: Compiling
3461
shell: bash
@@ -45,6 +72,7 @@ jobs:
4572
strategy:
4673
matrix:
4774
sys: [ mingw64, mingw32, ucrt64, clang64 ]
75+
shared: [shared, static]
4876
defaults:
4977
run:
5078
shell: msys2 {0}
@@ -56,7 +84,14 @@ jobs:
5684
pacboy: cc:p cmake:p ninja:p
5785
- uses: actions/checkout@v4
5886
- name: Generating Makefiles
59-
run: cmake .
87+
shell: bash
88+
run: |
89+
if [[ "${{ matrix.shared }}" == "shared" ]] ; then
90+
shared=on
91+
else
92+
shared=off
93+
fi
94+
cmake . -DBUILD_SHARED_LIBS=$shared
6095
- name: Compiling
6196
run: cmake --build .
6297
- name: Test

0 commit comments

Comments
 (0)