Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "kit"

Module for controlling and working with Kits.

Index

Type aliases

ProgressReporter

ProgressReporter: vscode.Progress<object>

Variables

Const MSVC_ENVIRONMENT_VARIABLES

MSVC_ENVIRONMENT_VARIABLES: string[] = ['CL','_CL_','INCLUDE','LIBPATH','LINK','_LINK_','LIB','PATH','TMP','FRAMEWORKDIR','FRAMEWORKDIR64','FRAMEWORKVERSION','FRAMEWORKVERSION64','UCRTCONTEXTROOT','UCRTVERSION','UNIVERSALCRTSDKDIR','VCINSTALLDIR','VCTARGETSPATH','WINDOWSLIBPATH','WINDOWSSDKDIR','WINDOWSSDKLIBVERSION','WINDOWSSDKVERSION','VISUALSTUDIOVERSION']

List of environment variables required for Visual C++ to run as expected for a VS installation.

Const OLD_USER_KITS_FILEPATH

OLD_USER_KITS_FILEPATH: string = path.join(process.platform === 'win32' ? paths.roamingDataDir : paths.dataDir, 'cmake-tools.json')

The old path where kits were stored. Upgraded in 1.1.3

Const USER_KITS_FILEPATH

USER_KITS_FILEPATH: string = path.join(paths.dataDir, 'cmake-tools-kits.json')

The path to the user-local kits file.

Const log

log: Logger = logging.createLogger('kit')

Functions

collectDevBatVars

  • collectDevBatVars(devbat: string, args: string[], major_version: number, common_dir: string): Promise<Map<string, string> | undefined>
  • Get the environment variables corresponding to a VS dev batch file.

    Parameters

    • devbat: string

      Path to a VS environment batch file

    • args: string[]

      List of arguments to pass to the batch file

    • major_version: number
    • common_dir: string

    Returns Promise<Map<string, string> | undefined>

convertMingwDirsToSearchPaths

  • convertMingwDirsToSearchPaths(mingwDirs: string[]): string[]
  • Parameters

    • mingwDirs: string[]

    Returns string[]

descriptionForKit

  • descriptionForKit(kit: Kit): string
  • Generates a string description of a kit. This is shown to the user.

    Parameters

    • kit: Kit

      The kit to generate a description for

    Returns string

effectiveKitEnvironment

  • effectiveKitEnvironment(kit: Kit): Promise<Map<string, string>>
  • Parameters

    Returns Promise<Map<string, string>>

findCLCompilerPath

  • findCLCompilerPath(env: Map<string, string>): Promise<string | null>
  • Parameters

    • env: Map<string, string>

    Returns Promise<string | null>

getClangVersion

  • getClangVersion(binPath: string): Promise<ClangVersion | null>

getVSKitEnvironment

  • getVSKitEnvironment(kit: Kit): Promise<Map<string, string> | null>
  • Parameters

    Returns Promise<Map<string, string> | null>

kitChangeNeedsClean

  • kitChangeNeedsClean(newKit: Kit, oldKit: Kit | null): boolean
  • Parameters

    • newKit: Kit
    • oldKit: Kit | null

    Returns boolean

kitIfCompiler

  • Convert a binary (by path) to a CompilerKit. This checks if the named binary is a GCC or Clang compiler and gets its version. If it is not a compiler, returns null.

    Parameters

    Returns Promise<Kit | null>

    A CompilerKit, or null if bin is not a known compiler

kitsAvailableInWorkspaceDirectory

  • kitsAvailableInWorkspaceDirectory(dirPath: string): Promise<Kit[]>
  • Get the kits available for a given workspace directory. Differs from kitsForWorkspaceDirectory in that it also returns kits declared in the user-local kits file.

    Parameters

    • dirPath: string

      The path to a VSCode workspace directory

    Returns Promise<Kit[]>

kitsForWorkspaceDirectory

  • kitsForWorkspaceDirectory(dirPath: string): Promise<Kit[]>
  • Get the kits declared for the given workspace directory. Looks in .vscode/cmake-kits.json.

    Parameters

    • dirPath: string

      The path to a VSCode workspace directory

    Returns Promise<Kit[]>

kitsPathForWorkspaceDirectoryPath

  • kitsPathForWorkspaceDirectoryPath(dirPath: string): string
  • Get the path to a workspace-specific cmake-kits.json for a given worksapce directory

    Parameters

    • dirPath: string

      The directory of a workspace

    Returns string

kitsPathForWorkspaceFolder

  • kitsPathForWorkspaceFolder(ws: vscode.WorkspaceFolder): string
  • Get the path to the workspace-specific cmake-kits.json for a given WorkspaceFolder object

    Parameters

    • ws: vscode.WorkspaceFolder

      The workspace folder

    Returns string

readKitsFile

  • readKitsFile(filepath: string): Promise<Kit[]>
  • Parameters

    • filepath: string

    Returns Promise<Kit[]>

scanDirForClangCLKits

scanDirForCompilerKits

  • Scans a directory for compiler binaries.

    Parameters

    • dir: string

      Directory containing candidate binaries

    • Optional pr: ProgressReporter

    Returns Promise<Kit[]>

    A list of CompilerKits found

scanDirectory

  • scanDirectory<Ret>(dir: string, mapper: function): Promise<Ret[]>
  • Type parameters

    • Ret

    Parameters

    • dir: string
    • mapper: function
        • (filePath: string): Promise<Ret | null>
        • Parameters

          • filePath: string

          Returns Promise<Ret | null>

    Returns Promise<Ret[]>

scanForClangCLKits

  • scanForClangCLKits(searchPaths: string[]): Promise<Promise<Kit[]>[]>
  • Parameters

    • searchPaths: string[]

    Returns Promise<Promise<Kit[]>[]>

scanForKits

  • Search for Kits available on the platform.

    Parameters

    Returns Promise<Kit[]>

    A list of Kits.

scanForVSKits

  • Scans the system for Visual C++ installations using vswhere

    Parameters

    Returns Promise<Kit[]>

tryCreateNewVCEnvironment

  • Try to get a VSKit from a VS installation and architecture

    Parameters

    Returns Promise<Kit | null>

varsForVSInstallation

  • varsForVSInstallation(inst: VSInstallation, arch: string): Promise<Map<string, string> | null>

vsInstallations

  • Get a list of all Visual Studio installations available from vswhere.exe

    Will not include older versions. vswhere doesn't seem to list them?

    Returns Promise<VSInstallation[]>

Object literals

Const VsArchitectures

VsArchitectures: object

Platform arguments for VS Generators

amd64

amd64: string = "x64"

amd64_arm

amd64_arm: string = "ARM"

arm

arm: string = "ARM"

Const VsGenerators

VsGenerators: object

Preferred CMake VS generators by VS version

11

11: string = "Visual Studio 11 2012"

12

12: string = "Visual Studio 12 2013"

14

14: string = "Visual Studio 14 2015"

15

15: string = "Visual Studio 15 2017"

VS120COMNTOOLS

VS120COMNTOOLS: string = "Visual Studio 12 2013"

VS140COMNTOOLS

VS140COMNTOOLS: string = "Visual Studio 14 2015"

Generated using TypeDoc