Add option to clean output before running configure/build (Enhancement #6)
This commit is contained in:
Родитель
78044a4aa8
Коммит
c50da5961a
|
@ -96,6 +96,11 @@
|
|||
"default": "${workspaceRoot}/build",
|
||||
"description": "The directory where CMake build files will go"
|
||||
},
|
||||
"cmake.clearOutputBeforeBuild": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Clear build output before each build"
|
||||
},
|
||||
"cmake.configureSettings": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
|
|
16
src/cmake.ts
16
src/cmake.ts
|
@ -487,7 +487,15 @@ export class CMakeTools {
|
|||
return null;
|
||||
}
|
||||
|
||||
public configure = async function (extra_args: string[] = []): Promise<Number> {
|
||||
private _prebuild = async function () {
|
||||
const self: CMakeTools = this;
|
||||
if (self.config<boolean>("clearOutputBeforeBuild")) {
|
||||
self._channel.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public configure = async function (extra_args: string[] = [], run_prebuild = true): Promise<Number> {
|
||||
const self: CMakeTools = this;
|
||||
|
||||
if (self.isBusy) {
|
||||
|
@ -513,6 +521,9 @@ export class CMakeTools {
|
|||
return;
|
||||
}
|
||||
|
||||
if (run_prebuild)
|
||||
await self._prebuild();
|
||||
|
||||
const binary_dir = self.binaryDir;
|
||||
const cmake_cache = self.cachePath;
|
||||
self._channel.show();
|
||||
|
@ -575,8 +586,9 @@ export class CMakeTools {
|
|||
if (!do_configure || await self.configure() !== 0)
|
||||
return -1;
|
||||
}
|
||||
await self._prebuild();
|
||||
if (self._needsReconfigure) {
|
||||
const retc = await self.configure();
|
||||
const retc = await self.configure([], false);
|
||||
if (!!retc)
|
||||
return retc;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче