#include "utils.h"
#include "log.h"
+#include <cstdio>
+#include <vector>
#include <memory>
#include <Ecore.h>
bool standalone = false;
const char* standalonePath = nullptr;
+ std::vector<char*> vargs;
+
for (i=1; i<argc; i++)
{
if (StandaloneOption.compare(argv[i]) == 0)
{
standalone = true;
+
+ if (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]);
}
}
_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;