Skip to content

Commit

Permalink
find Best Generator (#2600)
Browse files Browse the repository at this point in the history
  • Loading branch information
elahehrashedi authored Jun 14, 2022
1 parent e5ea0cf commit 9830fb0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## 1.11.26
- Revert back to the previous CMake language server extension dependency. [PR #2599](https://github.com/microsoft/vscode-cmake-tools/pull/2599)

Bug Fixes:
- Ninja is used as a default generator. [#2598](https://github.com/microsoft/vscode-cmake-tools/issues/2598)

## 1.11.25
Improvements:
- Fix build Error: EMFILE: too many open files. [#2288](https://github.com/microsoft/vscode-cmake-tools/issues/2288) [@FrogTheFrog](https://github.com/FrogTheFrog)
Expand Down
9 changes: 8 additions & 1 deletion src/drivers/cmakeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,12 @@ export abstract class CMakeDriver implements vscode.Disposable {
}
}

isCommonGenerator(genName: string): boolean {
return genName === 'Ninja' || genName === 'Ninja Multi-Config' ||
genName === 'MinGW Makefiles' || genName === 'NMake Makefiles' ||
genName === 'Unix Makefiles' || genName === 'MSYS Makefiles';
}

/**
* Picks the best generator to use on the current system
*/
Expand Down Expand Up @@ -809,7 +815,8 @@ export abstract class CMakeDriver implements vscode.Disposable {
if (gen.name.toLowerCase().startsWith('xcode') && platform === 'darwin') {
return gen;
}
if (this.cmakeGenerators.indexOf(gen.name) >= 0) {
// If it is not a common generator that we can find, but it is a known cmake generator (cmakeGenerators), return it.
if (this.cmakeGenerators.indexOf(gen.name) >= 0 && !this.isCommonGenerator(gen.name)) {
return gen;
}
continue;
Expand Down

0 comments on commit 9830fb0

Please sign in to comment.