aboutsummaryrefslogtreecommitdiffstats
path: root/qt-cpp
diff options
context:
space:
mode:
authorOrkun Tokdemir <orkun.tokdemir@qt.io>2024-10-09 15:14:37 +0200
committerOrkun Tokdemir <orkun.tokdemir@qt.io>2024-10-09 15:07:39 +0000
commit9629ecd014b66d13293f771dd0cea45d60a8a1d9 (patch)
tree39a048befa83ee6e85cfbf613edbcedf67c200e1 /qt-cpp
parentd352d07d7409d375fd24998b20561fff000bb2ed (diff)
qt-cpp: Remove redundant directories from `PATH`
Fixes: VSCODEEXT-69 Change-Id: I5e6a8b7900ce7e0cabf2acc9b7a9706ee8a9351f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qt-cpp')
-rw-r--r--qt-cpp/src/kit-manager.ts20
1 files changed, 13 insertions, 7 deletions
diff --git a/qt-cpp/src/kit-manager.ts b/qt-cpp/src/kit-manager.ts
index ffe31bc..7bb0fbd 100644
--- a/qt-cpp/src/kit-manager.ts
+++ b/qt-cpp/src/kit-manager.ts
@@ -18,7 +18,8 @@ import {
findQtKits,
isError,
QtInfo,
- QtAdditionalPath
+ QtAdditionalPath,
+ IsWindows
} from 'qt-lib';
import * as qtPath from '@util/get-qt-paths';
import { CppProject } from '@/project';
@@ -379,12 +380,13 @@ export class KitManager {
}
private static generateEnvPathForQtInstallation(installation: string) {
+ if (!IsWindows) {
+ return undefined;
+ }
const installationBinDir = path.join(installation, 'bin');
- const QtPathAddition = [
- installation,
- installationBinDir,
- '${env:PATH}'
- ].join(path.delimiter);
+ const QtPathAddition = [installationBinDir, '${env:PATH}'].join(
+ path.delimiter
+ );
return QtPathAddition;
}
@@ -404,7 +406,11 @@ export class KitManager {
locatedNinjaExePath = await promiseNinjaExecutable;
}
if (locatedNinjaExePath) {
- qtPathEnv += path.delimiter + path.dirname(locatedNinjaExePath);
+ if (qtPathEnv) {
+ qtPathEnv += path.delimiter + path.dirname(locatedNinjaExePath);
+ } else {
+ qtPathEnv = path.dirname(locatedNinjaExePath);
+ }
}
const kitName = qtPath.mangleQtInstallation(qtInsRoot, installation);
const kitPreferredGenerator = kitName.toLowerCase().includes('wasm_')