diff options
author | Eddie Hung <eddie.hung+gitlab@gmail.com> | 2018-07-15 19:22:57 +0000 |
---|---|---|
committer | Eddie Hung <eddie.hung+gitlab@gmail.com> | 2018-07-15 19:22:57 +0000 |
commit | 0bae7f5606b15591a23fb63da1c5ff6f93b40747 (patch) | |
tree | 7b0760fa1e5c837f9b43cf1c97fa9f55973a169b /generic/main.cc | |
parent | 1457a6453c11af34a73460868833a9462e987854 (diff) | |
parent | 21bf78dae9ef95e65b549c60061bce9790b1b611 (diff) | |
download | nextpnr-0bae7f5606b15591a23fb63da1c5ff6f93b40747.tar.gz nextpnr-0bae7f5606b15591a23fb63da1c5ff6f93b40747.tar.bz2 nextpnr-0bae7f5606b15591a23fb63da1c5ff6f93b40747.zip |
Merge branch 'master' into 'master'
Master
See merge request eddiehung/nextpnr!1
Diffstat (limited to 'generic/main.cc')
-rw-r--r-- | generic/main.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/generic/main.cc b/generic/main.cc index d025d8d4..3b8b3fe6 100644 --- a/generic/main.cc +++ b/generic/main.cc @@ -90,24 +90,34 @@ int main(int argc, char *argv[]) return 1; } - Context ctx(ArchArgs{}); + std::unique_ptr<Context> ctx = std::unique_ptr<Context>(new Context(ArchArgs{})); if (vm.count("verbose")) { - ctx.verbose = true; + ctx->verbose = true; } if (vm.count("force")) { - ctx.force = true; + ctx->force = true; } if (vm.count("seed")) { - ctx.rngseed(vm["seed"].as<int>()); + ctx->rngseed(vm["seed"].as<int>()); } +#ifndef NO_GUI + if (vm.count("gui")) { + Application a(argc, argv); + MainWindow w(std::move(ctx)); + w.show(); + + return a.exec(); + } +#endif + #ifndef NO_PYTHON if (vm.count("run")) { init_python(argv[0], true); - python_export_global("ctx", ctx); + python_export_global("ctx", *ctx.get()); std::vector<std::string> files = vm["run"].as<std::vector<std::string>>(); for (auto filename : files) @@ -117,15 +127,6 @@ int main(int argc, char *argv[]) } #endif -#ifndef NO_GUI - if (vm.count("gui")) { - Application a(argc, argv); - MainWindow w; - w.show(); - - rc = a.exec(); - } -#endif return rc; } catch (log_execution_error_exception) { #if defined(_MSC_VER) |