File tree Expand file tree Collapse file tree 2 files changed +42
-5
lines changed Expand file tree Collapse file tree 2 files changed +42
-5
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,40 @@ jobs:
48
48
uses : actions/checkout@v2
49
49
50
50
- name : CMake Configure
51
- run : cmake -B ${{github.workspace}}/build -G"Ninja" -DINT_TREE_BUILD_EXAMPLES=on -DINT_TREE_ENABLE_TESTS=on -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }}
51
+ run : cmake -B ${{github.workspace}}/build -G"Ninja" -DINT_TREE_USE_OPTIONAL_POLYFILL=on - DINT_TREE_BUILD_EXAMPLES=on -DINT_TREE_ENABLE_TESTS=on -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }}
52
52
53
53
- name : Build
54
54
run : cmake --build ${{github.workspace}}/build
55
55
56
56
- name : Test
57
57
working-directory : ${{github.workspace}}/build
58
- run : ./tests/tree-tests
58
+ run : ./tests/tree-tests
59
+
60
+ msvc :
61
+ runs-on : windows-latest
62
+ steps :
63
+ - name : Checkout
64
+ uses : actions/checkout@v2
65
+
66
+ - name : Setup MSVC
67
+
68
+
69
+ - name : Install vcpkg and gtest
70
+ run : |
71
+ git clone https://github.com/microsoft/vcpkg.git
72
+ .\vcpkg\bootstrap-vcpkg.bat
73
+ .\vcpkg\vcpkg.exe install gtest
74
+ shell : pwsh
75
+ env :
76
+ VCPKG_DEFAULT_TRIPLET : x64-windows
77
+
78
+ - name : CMake Configure
79
+ run : cmake -B ${{github.workspace}}/build -G"Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_CXX_STANDARD=20 -DINT_TREE_USE_OPTIONAL_POLYFILL=on -DINT_TREE_BUILD_EXAMPLES=on -DINT_TREE_ENABLE_TESTS=on -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
80
+
81
+ - name : Build
82
+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
83
+
84
+ - name : Test
85
+ working-directory : ${{github.workspace}}/build
86
+ run : .\tests\tree-tests.exe
87
+ shell : cmd
Original file line number Diff line number Diff line change @@ -19,17 +19,25 @@ file(GLOB sources "*.cpp")
19
19
# Add Executable
20
20
add_executable (tree -tests ${sources} )
21
21
22
- target_link_libraries (tree -tests PRIVATE gtest gmock interval-tree )
22
+ find_package (GTest REQUIRED )
23
+
24
+ target_link_libraries (tree -tests PRIVATE interval-tree GTest::gtest GTest::gmock GTest::gmock_main )
23
25
24
26
# Compiler Options
25
27
set (DEBUG_OPTIONS -fexceptions -g -Wall -pedantic-errors -pedantic )
26
28
target_compile_options (tree -tests PUBLIC "$<$<CONFIG:DEBUG>:${DEBUG_OPTIONS} >" )
27
29
28
- set (RELEASE_OPTIONS -fexceptions -O3 -Wall -pedantic )
30
+ if (${MSVC} )
31
+ set (WARNING_FLAGS -W4 )
32
+ else ()
33
+ set (WARNING_FLAGS -Wall )
34
+ list (APPEND WARNING_FLAGS -Wextra )
35
+ endif ()
36
+ set (RELEASE_OPTIONS -fexceptions -O3 ${WARNING_FLAGS} -pedantic )
29
37
target_compile_options (tree -tests PUBLIC "$<$<CONFIG:RELEASE>:${RELEASE_OPTIONS} >" )
30
38
31
39
if (INT_TREE_DRAW_EXAMPLES )
32
- target_link_libraries (tree -tests PRIVATE cairo cairo -wrap )
40
+ target_link_libraries (tree -tests PRIVATE cairo-wrap cairo )
33
41
endif ()
34
42
35
43
# If msys2, copy dynamic libraries to executable directory, visual studio does this automatically.
You can’t perform that action at this time.
0 commit comments