MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / das_aot_main

Function das_aot_main

utils/daScript/main.cpp:140–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140int das_aot_main ( int argc, char * argv[] ) {
141 setCommandLineArguments(argc, argv);
142 #ifdef _MSC_VER
143 _CrtSetReportMode(_CRT_ASSERT, 0);
144 _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
145 #endif
146 if ( argc<=3 ) {
147 tout << "daslang -aot <in_script.das> <out_script.das.cpp> [-v2Syntax] [-v1Syntax] [-v2makeSyntax] [-project <project file>] [-dasroot <dasroot folder>] [-q] [-j] [-aot-macros] [-cross-platform] [-no-lint] [-log-compile-time]\n";
148 return -1;
149 }
150 bool dryRun = false;
151 bool cross_platform = false; // strcmp("-aotlib", argv[1]) == 0;
152 bool scriptArgs = false;
153 bool das_mode = false;
154 vector<pair<string, string>> aot_files;
155 string project_root;
156 vector<string> load_modules;
157 if ( argc>3 ) {
158 for (int ai = 1; ai != argc; ++ai) {
159 if ( strcmp(argv[ai],"-q")==0 ) {
160 quiet = true;
161 } else if ( strcmp(argv[ai],"-aot")==0 || strcmp(argv[ai],"-aotlib")==0 ) {
162 if (ai + 2 >= argc) {
163 tout << "-aot requires 2 arguments <in> <out>.";
164 return -1;
165 }
166 aot_files.emplace_back(argv[ai + 1], argv[ai + 2]);
167 ai += 2;
168 } else if ( strcmp(argv[ai],"-p")==0 ) {
169 paranoid_validation = true;
170 } else if ( strcmp(argv[ai],"-dry-run")==0 ) {
171 dryRun = true;
172 } else if ( strcmp(argv[ai],"-das-mode")==0 ) {
173 das_mode = true;
174 } else if ( strcmp(argv[ai],"-cross-platform")==0 ) {
175 cross_platform = true;
176 } else if ( strcmp(argv[ai],"-aot-macros")==0 ) {
177 aotMacros = true;
178 } else if ( strcmp(argv[ai],"-project")==0 ) {
179 if ( ai+1 > argc ) {
180 tout << "das-project requires argument";
181 return -1;
182 }
183 projectFile = argv[ai+1];
184 ai += 1;
185 } else if ( strcmp(argv[ai],"-dasroot")==0 ) {
186 if ( ai+1 > argc ) {
187 tout << "dasroot requires argument";
188 return -1;
189 }
190 setDasRoot(argv[ai+1]);
191 ai += 1;
192 } else if ( strcmp(argv[ai],"-project-root")==0 || strcmp(argv[ai],"-project_root")==0 ) {
193 project_root = argv[ai + 1];
194 ai++;
195 } else if ( strcmp(argv[ai],"-load-module")==0 || strcmp(argv[ai],"-load_module")==0 ) {
196 if ( ai+1 >= argc ) {
197 tout << "-load_module requires path argument";

Callers 1

MAIN_FUNC_NAMEFunction · 0.85

Calls 10

setCommandLineArgumentsFunction · 0.85
setDasRootFunction · 0.85
register_builtin_modulesFunction · 0.85
require_dynamic_modulesFunction · 0.85
getDasRootFunction · 0.85
aot_compileFunction · 0.85
push_backMethod · 0.45
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected