From 99bad11502a87c138c93fae7b7e44b6f831153aa Mon Sep 17 00:00:00 2001 From: vector-of-bool Date: Thu, 29 Sep 2016 22:42:43 -0600 Subject: [PATCH] Allow explicitly and unconditionally setting the generator to use (Address issue #33) --- package.json | 5 +++++ src/cmake.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/package.json b/package.json index 7c7f22e6c..d0ff44540 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/cmake.ts b/src/cmake.ts index 0146d6def..75c1fc61b 100644 --- a/src/cmake.ts +++ b/src/cmake.ts @@ -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> { + // The user can override our automatic selection logic in their config + const generator = this.config>('generator'); + if (generator) { + // User has explicitly requested a certain generator. Use that one. + return generator; + } for (const gen of candidates) { if (!gen) continue;