WebAssembly: fix crashes

Change-Id: I9a2a44c85a254628f119eb041036492bc3022cdf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Tim Jenssen
2019-10-25 19:48:48 +02:00
committed by Tim Jenssen
parent e3904f3b13
commit 51991e3a3e
2 changed files with 34 additions and 28 deletions

View File

@@ -42,17 +42,19 @@ namespace Internal {
static CommandLine emrunCommand(Target *target, const QString &browser, const QString &port)
{
BuildConfiguration *bc = target->activeBuildConfiguration();
const QFileInfo emrunScript = bc->environment().searchInPath("emrun").toFileInfo();
auto html = bc->buildDirectory().pathAppended(target->project()->displayName() + ".html");
if (BuildConfiguration *bc = target->activeBuildConfiguration()) {
const QFileInfo emrunScript = bc->environment().searchInPath("emrun").toFileInfo();
auto html = bc->buildDirectory().pathAppended(target->project()->displayName() + ".html");
return CommandLine(bc->environment().searchInPath("python"), {
emrunScript.absolutePath() + "/" + emrunScript.baseName() + ".py",
"--browser", browser,
"--port", port,
"--no_emrun_detect",
html.toString()
});
return CommandLine(bc->environment().searchInPath("python"), {
emrunScript.absolutePath() + "/" + emrunScript.baseName() + ".py",
"--browser", browser,
"--port", port,
"--no_emrun_detect",
html.toString()
});
}
return {};
}
// Runs a webassembly application via emscripten's "emrun" tool