File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -95,10 +95,14 @@ win-build:
95
95
- .shared_windows_runners
96
96
stage : win
97
97
script :
98
+ - git clone https://github.com/tronkko/dirent.git
98
99
- mkdir build
99
100
- cd build
100
- - cmake -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=ON ..
101
+ - cmake -DCMAKE_INCLUDE_PATH="../dirent/include" - DBUILD_DOCS=OFF -DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON ..
101
102
- cmake --build .
103
+ # due to the long provisioning time of the Windows runner, tests are
104
+ # executed in the same stage as the build
105
+ - ctest -C Debug --verbose
102
106
artifacts :
103
107
paths :
104
108
- install/
Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.12 )
1
+ cmake_minimum_required (VERSION 3.18 )
2
2
3
3
project (iniparser VERSION 4.2.2 )
4
4
Original file line number Diff line number Diff line change @@ -9,6 +9,21 @@ find_program(
9
9
PATH
10
10
REQUIRED )
11
11
12
+ if (MSVC )
13
+ message (STATUS "MSVC environment" )
14
+ find_file (
15
+ MSVC_DIRENT
16
+ "dirent.h"
17
+ REQUIRED )
18
+ message (STATUS "MSVC_DIRENT: ${MSVC_DIRENT} " )
19
+ get_filename_component (
20
+ MSVC_DIRENT_INCLUDE_DIR
21
+ ${MSVC_DIRENT}
22
+ DIRECTORY )
23
+ message (STATUS "MSVC_DIRENT_INCLUDE_DIR: ${MSVC_DIRENT_INCLUDE_DIR} " )
24
+ include_directories (${MSVC_DIRENT_INCLUDE_DIR} )
25
+ endif ()
26
+
12
27
set (FETCHCONTENT_QUIET OFF )
13
28
14
29
FetchContent_Declare (
@@ -45,6 +60,11 @@ function(create_test_runner)
45
60
46
61
add_executable (test_${TEST_RUNNER_NAME} test_${TEST_RUNNER_NAME}.c
47
62
test_${TEST_RUNNER_NAME}_runner.c )
63
+ # Prevent MSVC from creating Debug or Release subdirectories for test
64
+ # executables
65
+ set_target_properties (
66
+ test_${TEST_RUNNER_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
67
+ ${CMAKE_CURRENT_BINARY_DIR} /$<0:> )
48
68
foreach (TARGET_TYPE ${TARGET_TYPES} )
49
69
# if BUILD_STATIC_LIBS=ON shared takes precedence
50
70
target_link_libraries (
You can’t perform that action at this time.
0 commit comments