File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ endif ()
13
13
14
14
add_subdirectory (lexer_gen)
15
15
16
- set (PL_STATICLEXERPATH "${CMAKE_CURRENT_SOURCE_DIR} /include/pl/core/lexer_static.hpp" )
16
+ set (PL_STATICLEXERPATH "${CMAKE_CURRENT_SOURCE_DIR} /include/pl/core/generated/ lexer_static.hpp" )
17
17
18
18
add_custom_command (
19
19
OUTPUT ${PL_STATICLEXERPATH}
Original file line number Diff line number Diff line change
1
+ # Ignore generated code folder
2
+ generated /
Original file line number Diff line number Diff line change @@ -10,15 +10,25 @@ step to optimize application start-up time.
10
10
#include < lexertl/generate_cpp.hpp>
11
11
12
12
#include < fstream>
13
- #include < iostream >
13
+ #include < filesystem >
14
14
15
15
int main (int argc, char *argv[])
16
16
{
17
17
if (argc!=2 )
18
18
return 1 ;
19
19
20
- lexertl::state_machine sm;
20
+ try
21
+ {
22
+ std::filesystem::path argPath (argv[1 ]);
23
+ std::filesystem::path genDir = argPath.parent_path ();
24
+ std::filesystem::create_directory (genDir);
25
+ }
26
+ catch (const std::filesystem::filesystem_error &fse)
27
+ {
28
+ return 1 ;
29
+ }
21
30
31
+ lexertl::state_machine sm;
22
32
pl::core::newLexerBuild (sm);
23
33
sm.minimise ();
24
34
Original file line number Diff line number Diff line change 13
13
#include < lexertl/generator.hpp>
14
14
15
15
#if defined(NDEBUG)
16
- #include < pl/core/lexer_static.hpp>
16
+ #include < pl/core/generated/ lexer_static.hpp>
17
17
#endif
18
18
19
19
#include < cstddef>
You can’t perform that action at this time.
0 commit comments