Skip to content

Commit

Permalink
qt-cpp: Add rest of the environment path to path variable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
OrkunTokdemir committed Jan 14, 2025
1 parent 7f03010 commit 35f3ed9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qt-cpp/src/kit-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export class KitManager {

private static generateEnvPathForQtInstallation(installation: string) {
if (!IsWindows) {
return undefined;
return envPath;
}
const installationBinDir = path.join(installation, 'bin');
const QtPathAddition = [installationBinDir, envPath].join(path.delimiter);
Expand Down Expand Up @@ -544,7 +544,8 @@ export class KitManager {
newKit.name = kitName;
newKit.environmentVariables = {
VSCODE_QT_INSTALLATION: installation,
PATH: qtPathEnv
// If it is just envPath, not need to set it.
PATH: qtPathEnv === envPath ? undefined : qtPathEnv
};

const toolchainFilePath = await promiseCmakeQtToolchainPath;
Expand Down

0 comments on commit 35f3ed9

Please sign in to comment.