File tree 3 files changed +43
-6
lines changed
3 files changed +43
-6
lines changed Original file line number Diff line number Diff line change 2
2
configure_file (${PROJECT_SOURCE_DIR} /tools/config.h.in ${PROJECT_BINARY_DIR} /tools/config.h @ONLY)
3
3
4
4
add_subdirectory (lint)
5
- add_subdirectory (re)
5
+ if (NOT WIN32 )
6
+ add_subdirectory (re)
7
+ endif ()
6
8
7
9
set (format_sources
8
10
${format_sources}
Original file line number Diff line number Diff line change 1
1
# yanglint
2
2
3
+ if (WIN32 )
4
+ set (YANGLINT_INTERACTIVE OFF )
5
+ else ()
6
+ set (YANGLINT_INTERACTIVE ON )
7
+ endif ()
8
+
3
9
set (lintsrc
4
- main.c
5
10
main_ni.c
6
11
cmd.c
7
12
cmd_add.c
@@ -13,9 +18,17 @@ set(lintsrc
13
18
cmd_print.c
14
19
cmd_searchpath.c
15
20
common.c
16
- completion.c
17
- configuration .c
18
- linenoise/linenoise.c)
21
+ )
22
+ if (YANGLINT_INTERACTIVE)
23
+ set (lintsrc ${lintsrc}
24
+ main.c
25
+ completion.c
26
+ configuration .c
27
+ linenoise/linenoise.c)
28
+ else ()
29
+ set (lintsrc ${lintsrc}
30
+ main_ni_only.c)
31
+ endif ()
19
32
20
33
set (format_sources
21
34
${format_sources}
@@ -53,7 +66,7 @@ if(ENABLE_TESTS)
53
66
find_program (PATH_EXPECT NAMES expect)
54
67
if (NOT PATH_EXPECT)
55
68
message (WARNING "'expect' not found! The yanglint(1) interactive tests will not be available." )
56
- else ( )
69
+ elseif (YANGLINT_INTERACTIVE )
57
70
# add_yanglint_test(NAME in_list SCRIPT expect/list.exp)
58
71
endif ()
59
72
endif ()
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @file main_ni_only.c
3
+ * @brief non-interactive implementation of main() for those platforms without the linenoise library
4
+ *
5
+ * Copyright (c) 2015-2021 CESNET, z.s.p.o.
6
+ *
7
+ * This source code is licensed under BSD 3-Clause License (the "License").
8
+ * You may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/BSD-3-Clause
12
+ */
13
+
14
+ int main_ni (int argc , char * argv []);
15
+
16
+ int done ; /* for cmd.c */
17
+
18
+ int
19
+ main (int argc , char * argv [])
20
+ {
21
+ return main_ni (argc , argv );
22
+ }
You can’t perform that action at this time.
0 commit comments