File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22configure_file (${PROJECT_SOURCE_DIR} /tools/config.h.in ${PROJECT_BINARY_DIR} /tools/config.h @ONLY )
33
44add_subdirectory (lint )
5- add_subdirectory (re )
5+ if (NOT WIN32 )
6+ add_subdirectory (re )
7+ endif ()
68
79set (format_sources
810 ${format_sources}
Original file line number Diff line number Diff line change 11# yanglint
22
3+ if (WIN32 )
4+ set (YANGLINT_INTERACTIVE OFF )
5+ else ()
6+ set (YANGLINT_INTERACTIVE ON )
7+ endif ()
8+
39set (lintsrc
4- main.c
510 main_ni.c
611 cmd.c
712 cmd_add.c
@@ -13,9 +18,17 @@ set(lintsrc
1318 cmd_print.c
1419 cmd_searchpath.c
1520 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 ()
1932
2033set (format_sources
2134 ${format_sources}
@@ -53,7 +66,7 @@ if(ENABLE_TESTS)
5366 find_program (PATH_EXPECT NAMES expect )
5467 if (NOT PATH_EXPECT)
5568 message (WARNING "'expect' not found! The yanglint(1) interactive tests will not be available." )
56- else ( )
69+ elseif (YANGLINT_INTERACTIVE )
5770# add_yanglint_test(NAME in_list SCRIPT expect/list.exp)
5871 endif ()
5972endif ()
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