| 177 | } |
| 178 | |
| 179 | int das_aot_main ( int argc, char * argv[] ) { |
| 180 | setCommandLineArguments(argc, argv); |
| 181 | #ifdef _MSC_VER |
| 182 | _CrtSetReportMode(_CRT_ASSERT, 0); |
| 183 | _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); |
| 184 | #endif |
| 185 | if ( argc<=3 ) { |
| 186 | tout << "daScript -aot <in_script.das> <out_script.das.cpp> [-q] [-j] [-dry-run]\n"; |
| 187 | return -1; |
| 188 | } |
| 189 | bool dryRun = false; |
| 190 | bool scriptArgs = false; |
| 191 | if ( argc>3 ) { |
| 192 | for (int ai = 4; ai != argc; ++ai) { |
| 193 | if ( strcmp(argv[ai],"-q")==0 ) { |
| 194 | quiet = true; |
| 195 | } else if ( strcmp(argv[ai],"-p")==0 ) { |
| 196 | paranoid_validation = true; |
| 197 | } else if ( strcmp(argv[ai],"-dry-run")==0 ) { |
| 198 | dryRun = true; |
| 199 | } else if ( strcmp(argv[ai],"-project")==0 ) { |
| 200 | if ( ai+1 > argc ) { |
| 201 | tout << "das-project requires argument"; |
| 202 | return -1; |
| 203 | } |
| 204 | projectFile = argv[ai+1]; |
| 205 | ai += 1; |
| 206 | } else if ( strcmp(argv[ai],"-dasroot")==0 ) { |
| 207 | if ( ai+1 > argc ) { |
| 208 | tout << "dasroot requires argument"; |
| 209 | return -1; |
| 210 | } |
| 211 | setDasRoot(argv[ai+1]); |
| 212 | ai += 1; |
| 213 | } else if ( strcmp(argv[ai],"--")==0 ) { |
| 214 | scriptArgs = true; |
| 215 | } else if ( !scriptArgs ) { |
| 216 | tout << "unsupported option " << argv[ai]; |
| 217 | return -1; |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | // register modules |
| 222 | if (!Module::require("$")) { |
| 223 | NEED_MODULE(Module_BuiltIn); |
| 224 | } |
| 225 | if (!Module::require("math")) { |
| 226 | NEED_MODULE(Module_Math); |
| 227 | } |
| 228 | if (!Module::require("raster")) { |
| 229 | NEED_MODULE(Module_Raster); |
| 230 | } |
| 231 | if (!Module::require("strings")) { |
| 232 | NEED_MODULE(Module_Strings); |
| 233 | } |
| 234 | if (!Module::require("rtti")) { |
| 235 | NEED_MODULE(Module_Rtti); |
| 236 | } |
no test coverage detected