WebAssembly: Support emsdk path with spaces on Linux/macOS

The command passed to bash as argument needs to be quoted.

Task-number: QTCREATORBUG-29981
Change-Id: I0e91ab4c088f8cd4e5a2df82604ea86cf73369fc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-12-12 16:06:25 +01:00
parent cf16ef3139
commit 3a8314f793

View File

@@ -51,7 +51,9 @@ static QString emSdkEnvOutput(const FilePath &sdkRoot)
emSdkEnv.setCommand(CommandLine(scriptFile));
} else {
// File needs to be source'd, not executed.
emSdkEnv.setCommand({sdkRoot.withNewPath("bash"), {"-c", ". " + scriptFile.path()}});
CommandLine cmd{sdkRoot.withNewPath("bash"), {"-c"}};
cmd.addCommandLineAsSingleArg({".", {scriptFile.path()}});
emSdkEnv.setCommand(cmd);
}
emSdkEnv.runBlocking();
const QString result = emSdkEnv.allOutput();