forked from qt-creator/qt-creator
Utils: Introduce a FilePath::withNewPath() convenience method
It's effectively the mirrored version of onDevice() with an equally odd name which is a bit more straightforward to use in some cases. Change-Id: I0cfedeb58871a857c93144e2a0d734bad1bcd887 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -162,7 +162,6 @@ QList<ToolChain *> WebAssemblyToolChainFactory::autoDetect(
|
||||
const IDevice::Ptr &device)
|
||||
{
|
||||
Q_UNUSED(alreadyKnown)
|
||||
Q_UNUSED(device)
|
||||
|
||||
const FilePath sdk = WebAssemblyEmSdk::registeredEmSdk();
|
||||
if (!WebAssemblyEmSdk::isValid(sdk))
|
||||
@@ -187,8 +186,7 @@ QList<ToolChain *> WebAssemblyToolChainFactory::autoDetect(
|
||||
const bool cLanguage = languageId == ProjectExplorer::Constants::C_LANGUAGE_ID;
|
||||
const QString script = QLatin1String(cLanguage ? "emcc" : "em++")
|
||||
+ QLatin1String(sdk.osType() == OsTypeWindows ? ".bat" : "");
|
||||
const FilePath scriptFile =
|
||||
FilePath::fromString(script).onDevice(sdk).searchOnDevice(env.path());
|
||||
const FilePath scriptFile = sdk.withNewPath(script).searchOnDevice(env.path());
|
||||
toolChain->setCompilerCommand(scriptFile);
|
||||
|
||||
const QString displayName = WebAssemblyToolChain::tr("Emscripten Compiler %1 for %2")
|
||||
|
||||
Reference in New Issue
Block a user