Skip to content

Commit

Permalink
Allow explicitly and unconditionally setting the generator to use
Browse files Browse the repository at this point in the history
(Address issue #33)
  • Loading branch information
vector-of-bool committed Sep 30, 2016
1 parent 60da29e commit 99bad11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@
"NMake Makefiles"
],
"description": "The preferred CMake generator(s) to use when configuring (tried in order of listing)"
},
"cmake.generator": {
"type": "string",
"default": null,
"description": "The CMake generator to use"
},
"cmake.parallelJobs": {
"type": "number",
Expand Down
6 changes: 6 additions & 0 deletions src/cmake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,12 @@ export class CMakeTools {

// Given a list of CMake generators, returns the first one available on this system
public async pickGenerator(candidates: string[]): Promise<Maybe<string>> {
// The user can override our automatic selection logic in their config
const generator = this.config<Maybe<string>>('generator');
if (generator) {
// User has explicitly requested a certain generator. Use that one.
return generator;
}
for (const gen of candidates) {
if (!gen)
continue;
Expand Down

0 comments on commit 99bad11

Please sign in to comment.