Skip to content

Commit a4788c0

Browse files
committed
MSW GH Workflow now on cmake
1 parent 85672dc commit a4788c0

File tree

3 files changed

+31
-41
lines changed

3 files changed

+31
-41
lines changed

.github/workflows/cmake-msw.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CMake Windows
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-2022
12+
strategy:
13+
matrix:
14+
build_type: [Debug, Release]
15+
16+
steps:
17+
- name: Clone
18+
uses: actions/checkout@v3
19+
20+
- name: Configure CMake
21+
run: cmake -B ${{github.workspace}}/build -DCINDER_BUILD_TESTS=ON -G "Visual Studio 17 2022" -A x64
22+
23+
- name: Build
24+
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --parallel
25+
26+
- name: Run Unit Tests
27+
run: ${{github.workspace}}/build/${{matrix.build_type}}/UnitTests.exe

.github/workflows/vc2022-msw.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

test/unit/proj/cmake/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ ci_make_app(
4242
INCLUDES "${UNIT_DIR}/src" # for catch.hpp
4343
)
4444

45-
if( APPLE )
46-
set( TESTBINDIR ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/UnitTests/UnitTests.app/Contents/MacOS )
47-
else()
48-
set( TESTBINDIR ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/UnitTests )
49-
endif()
45+
# Unit tests need to be a console app (not WIN32 GUI app) for output
46+
set_target_properties( UnitTests PROPERTIES WIN32_EXECUTABLE FALSE )
5047

5148
add_test(
5249
NAME UnitTests
53-
COMMAND ${TESTBINDIR}/UnitTests
50+
COMMAND $<TARGET_FILE:UnitTests>
51+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
5452
)

0 commit comments

Comments
 (0)