Skip to content

Commit 35f3ed9

Browse files
committed
qt-cpp: Add rest of the environment path to path variable
When ninja doesn't exist in PATH and on a unix based system, Ninja might be used from the Qt installation. In this case, the following output is generated. Output: `"PATH": "/home/orkun/Qt/Tools/Ninja"` The problem is that the above variable overrides the PATH variable completely and it causes compilers not to be found. This commit adds the rest of the environment path to the PATH variable for unix based systems when Ninja is not found in PATH.
1 parent 7f03010 commit 35f3ed9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qt-cpp/src/kit-manager.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ export class KitManager {
510510

511511
private static generateEnvPathForQtInstallation(installation: string) {
512512
if (!IsWindows) {
513-
return undefined;
513+
return envPath;
514514
}
515515
const installationBinDir = path.join(installation, 'bin');
516516
const QtPathAddition = [installationBinDir, envPath].join(path.delimiter);
@@ -544,7 +544,8 @@ export class KitManager {
544544
newKit.name = kitName;
545545
newKit.environmentVariables = {
546546
VSCODE_QT_INSTALLATION: installation,
547-
PATH: qtPathEnv
547+
// If it is just envPath, not need to set it.
548+
PATH: qtPathEnv === envPath ? undefined : qtPathEnv
548549
};
549550

550551
const toolchainFilePath = await promiseCmakeQtToolchainPath;

0 commit comments

Comments
 (0)