-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for cmake-tools extension
Add a cmake-kits.json, which allows the cmake-tools extension to compile the project, using the correct Ninja, Python, and compiler. Signed-off-by: William Vinnicombe <[email protected]>
- Loading branch information
Showing
5 changed files
with
174 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { CommandWithResult } from "./command.mjs"; | ||
import { workspace } from "vscode"; | ||
import { getPythonPath, getPath } from "../utils/cmakeUtil.mjs"; | ||
|
||
export class GetPythonPathCommand | ||
extends CommandWithResult<string> { | ||
constructor() { | ||
super("getPythonPath"); | ||
} | ||
|
||
async execute(): Promise<string> { | ||
if ( | ||
workspace.workspaceFolders === undefined || | ||
workspace.workspaceFolders.length === 0 | ||
) { | ||
return ""; | ||
} | ||
|
||
const pythonPath = await getPythonPath(); | ||
|
||
return pythonPath; | ||
} | ||
} | ||
|
||
export class GetEnvPathCommand | ||
extends CommandWithResult<string> { | ||
constructor() { | ||
super("getEnvPath"); | ||
} | ||
|
||
async execute(): Promise<string> { | ||
if ( | ||
workspace.workspaceFolders === undefined || | ||
workspace.workspaceFolders.length === 0 | ||
) { | ||
return ""; | ||
} | ||
|
||
const path = await getPath(); | ||
|
||
return path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters