|
|
@@ -499,22 +499,29 @@ int main(int argc, char** argv)
|
|
|
|
|
|
DeviceOptions opts(argc, argv);
|
|
|
|
|
|
+ int exitcode = opts.parse();
|
|
|
+ if (exitcode == EXIT_FAILURE)
|
|
|
+ {
|
|
|
+ return exitcode;
|
|
|
+ }
|
|
|
+
|
|
|
console_server_globals::init(opts.console_port(), opts.wait_console());
|
|
|
- bundle_compiler_globals::init(opts.source_dir(), opts.bundle_dir());
|
|
|
|
|
|
bool do_continue = true;
|
|
|
- int exitcode = EXIT_SUCCESS;
|
|
|
|
|
|
- do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
|
|
|
+ if (opts.do_compile())
|
|
|
+ {
|
|
|
+ bundle_compiler_globals::init(opts.source_dir(), opts.bundle_dir());
|
|
|
+ do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
|
|
|
+ }
|
|
|
|
|
|
if (do_continue)
|
|
|
- exitcode = crown::s_wdvc.run(&opts);
|
|
|
-
|
|
|
- bundle_compiler_globals::shutdown();
|
|
|
- console_server_globals::shutdown();
|
|
|
+ exitcode = crown::s_ldvc.run(&opts);
|
|
|
|
|
|
- WSACleanup();
|
|
|
+ if (opts.do_compile())
|
|
|
+ bundle_compiler_globals::shutdown();
|
|
|
|
|
|
+ console_server_globals::shutdown();
|
|
|
memory_globals::shutdown();
|
|
|
return exitcode;
|
|
|
}
|