Skip to content

Commit ca7a46a

Browse files
committed
misc: fix for release 3
1 parent f614889 commit ca7a46a

File tree

3 files changed

+37
-34
lines changed

3 files changed

+37
-34
lines changed

.github/workflows/notify-release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,43 @@ jobs:
3030
- name: Run Windows build
3131
run: cmake --build build --config Release
3232
- name: Run unit tests
33-
run: cd build ; .\Release\enet_test.exe
33+
run: cd build ; .\enet_test.exe
3434
- name: Release
3535
uses: softprops/action-gh-release@v1
3636
if: startsWith(github.ref, 'refs/tags/')
3737
with:
38-
files: build/Release/enet.dll
38+
files: build/enet_shared.dll
3939

4040
build-lin:
4141
name: Test Linux
4242
runs-on: ubuntu-latest
4343
steps:
4444
- uses: actions/checkout@v1
4545
- name: Run cmake generator
46-
run: cmake -B build -DENET_TEST=1 -DENET_SHARED=1
46+
run: cmake -B build -DENET_TEST=1 -DENET_SHARED=1 -DCMAKE_BUILD_TYPE=Release
4747
- name: Run build on Linux
48-
run: cmake --build build --config Release
48+
run: cmake --build build
4949
- name: Test build on Linux
50-
run: build/Release/enet_test
50+
run: build/enet_test
5151
- name: Release
5252
uses: softprops/action-gh-release@v1
5353
if: startsWith(github.ref, 'refs/tags/')
5454
with:
55-
files: build/Release/libenet.so
55+
files: build/libenet_shared.so
5656

5757
build-mac:
5858
name: Test macOS
5959
runs-on: macOS-latest
6060
steps:
6161
- uses: actions/checkout@v1
6262
- name: Run cmake generator
63-
run: cmake -B build -DENET_TEST=1 -DENET_SHARED=1
63+
run: cmake -B build -DENET_TEST=1 -DENET_SHARED=1 -DCMAKE_BUILD_TYPE=Release
6464
- name: Run build on macOS
65-
run: cmake --build build --config Release
65+
run: cmake --build build
6666
- name: Test build on macOS
67-
run: build/Release/enet_test
67+
run: build/enet_test
6868
- name: Release
6969
uses: softprops/action-gh-release@v1
7070
if: startsWith(github.ref, 'refs/tags/')
7171
with:
72-
files: build/Release/libenet.dylib
72+
files: build/libenet_shared.dylib

.github/workflows/tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
steps:
3636
- uses: actions/checkout@v1
3737
- name: Run cmake generator
38-
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DENET_TEST=1 -DENET_SHARED=1
38+
run: cmake -B build -DENET_TEST=1
3939
- name: Run Windows build
4040
run: cmake --build build
4141
- name: Run unit tests
42-
run: cd build ; .\Release\enet_test.exe
42+
run: cd build ; .\enet_test.exe
4343

4444
build-lin:
4545
name: Test Linux
@@ -48,11 +48,11 @@ jobs:
4848
steps:
4949
- uses: actions/checkout@v1
5050
- name: Run cmake generator
51-
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DENET_TEST=1 -DENET_SHARED=1
51+
run: cmake -B build -DENET_TEST=1
5252
- name: Run build on Linux
5353
run: cmake --build build
5454
- name: Test build on Linux
55-
run: build/Release/enet_test
55+
run: build/enet_test
5656

5757
build-mac:
5858
name: Test macOS
@@ -61,11 +61,11 @@ jobs:
6161
steps:
6262
- uses: actions/checkout@v1
6363
- name: Run cmake generator
64-
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DENET_TEST=1 -DENET_SHARED=1
64+
run: cmake -B build -DENET_TEST=1
6565
- name: Run build on macOS
6666
run: cmake --build build
6767
- name: Test build on macOS
68-
run: build/Release/enet_test
68+
run: build/enet_test
6969

7070
done:
7171
name: Notify about status

CMakeLists.txt

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
11
cmake_minimum_required(VERSION 3.0)
22
project(enet C)
33

4-
# defaults
5-
set(ENET_STATIC ON)
6-
set(ENET_SHARED OFF)
7-
set(ENET_TEST OFF)
8-
94
# configure projects
105
if (ENET_STATIC)
11-
add_library(enet STATIC test/library.c)
6+
add_library(enet_static STATIC test/library.c)
127

138
if (WIN32)
14-
target_link_libraries(enet PUBLIC winmm ws2_32)
9+
target_link_libraries(enet_static PUBLIC winmm ws2_32)
10+
11+
if(MSVC)
12+
target_compile_options(enet_static PRIVATE -W3)
13+
endif()
14+
else()
15+
target_compile_options(enet_static PRIVATE -Wno-error)
1516
endif()
17+
18+
target_include_directories(enet_static PUBLIC ${PROJECT_SOURCE_DIR}/include)
1619
endif()
1720

1821
if (ENET_SHARED)
19-
target_compile_definitions(enet PUBLIC -DENET_DLL)
20-
add_library(enet SHARED test/library.c)
22+
add_library(enet_shared SHARED test/library.c)
23+
target_compile_definitions(enet_shared PUBLIC -DENET_DLL)
2124

2225
if (WIN32)
23-
target_link_libraries(enet PUBLIC winmm ws2_32)
26+
target_link_libraries(enet_shared PUBLIC winmm ws2_32)
27+
28+
if(MSVC)
29+
target_compile_options(enet_shared PRIVATE -W3)
30+
endif()
31+
else()
32+
target_compile_options(enet_shared PRIVATE -Wno-error)
2433
endif()
34+
35+
target_include_directories(enet_shared PUBLIC ${PROJECT_SOURCE_DIR}/include)
2536
endif()
2637

2738
if (ENET_TEST)
@@ -33,11 +44,3 @@ if (ENET_TEST)
3344
endif()
3445
endif()
3546

36-
37-
if(MSVC)
38-
target_compile_options(enet PRIVATE -W3)
39-
else()
40-
target_compile_options(enet PRIVATE -Wno-error)
41-
endif()
42-
43-
target_include_directories(enet PUBLIC ${PROJECT_SOURCE_DIR}/include)

0 commit comments

Comments
 (0)