From a74953c665b4d5c177ebfaf014d2ba61f7e7906a Mon Sep 17 00:00:00 2001 From: "pius.lee" Date: Mon, 10 Oct 2016 19:03:12 +0900 Subject: [PATCH] Now options will be pass to managed launcher Commanline options will be pass to managed launcher except --standalone and assembly path. Change-Id: I2e853c23553152fb9291b4d586b50c133a5781ee --- NativeLauncher/src/main.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/NativeLauncher/src/main.cc b/NativeLauncher/src/main.cc index 97ff67c..41c0362 100644 --- a/NativeLauncher/src/main.cc +++ b/NativeLauncher/src/main.cc @@ -3,6 +3,8 @@ #include "utils.h" #include "log.h" +#include +#include #include #include @@ -16,16 +18,25 @@ int main(int argc, char *argv[]) bool standalone = false; const char* standalonePath = nullptr; + std::vector vargs; + for (i=1; i argc-1) + { + fprintf(stderr, "Assembly path must be after \"--standalone\" option\n"); + return 1; + } + i++; + standalonePath = argv[i]; } else { - if (standalonePath == nullptr) - standalonePath = argv[i]; + vargs.push_back(argv[i]); } } @@ -62,7 +73,10 @@ int main(int argc, char *argv[]) _ERR("Failed to run managed launcher"); return 1; } - if (!runtime->Launch(base.c_str(), standalonePath, argc, argv)) + + int args_len = vargs.size(); + char** args = &vargs[0]; + if (!runtime->Launch(base.c_str(), standalonePath, args_len, args)) { _ERR("Failed to launch"); return 1; -- 2.7.4