Skip to content

Commit

Permalink
Don't fail if CMakeLists.txt was appended to sourceDirectory (microso…
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbrow authored Jan 23, 2020
1 parent b1fe911 commit 4006a88
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/drivers/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ export abstract class CMakeDriver implements vscode.Disposable {
log.debug('Run _refreshExpansions cb');
const opts = this.expansionOptions;
this._sourceDirectory = util.lightNormalizePath(await expand.expandString(this.config.sourceDirectory, opts));
if (path.basename(this._sourceDirectory).toLocaleLowerCase() === "cmakelists.txt") {
// Don't fail if CMakeLists.txt was accidentally appended to the sourceDirectory.
this._sourceDirectory = path.dirname(this._sourceDirectory);
}
this._binaryDir = util.lightNormalizePath(await expand.expandString(this.config.buildDirectory, opts));

const installPrefix = this.config.installPrefix;
Expand Down

0 comments on commit 4006a88

Please sign in to comment.