rules/c/cmake/toolchain.js
Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.
CMAKE_TOOL
const CMAKE_TOOL
Undocumented.
cmakeArtifactName()
cmakeArtifactName(version, plat)
Return the CMake release artifact filename for a version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
cmakeDownloadUrl()
cmakeDownloadUrl(version, plat)
Return the CMake release download URL for a version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
cmakeSupportedPlatforms()
cmakeSupportedPlatforms()
Return the platforms CMake publishes release archives for, derived from the os/arch matrix this module already supports.
Returns: Array<{ os: string, arch: string }>
cmakeCacheKey()
cmakeCacheKey(version, plat)
Return the named-cache key for a CMake toolchain version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
CmakeToolchain (implementation class)
class CmakeToolchain
Implementation class. BUILD files should use cmakeToolchain().
Undocumented.
cmakeToolchain()
cmakeToolchain(version, opts = {})
Declare a CMake toolchain version and optionally set it as the default. matching lockfile entry (warns instead of failing).
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| [opts] | object | |
| [opts.default=false] | boolean | |
| [opts.unverified=false] | boolean | Allow downloading without a |
Returns: object Target handle for this CMake toolchain.
installCmakeToolchain()
installCmakeToolchain(version, source)
Install a local CMake toolchain directory into the named cache.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| source | string | Path to the toolchain root. |
Returns: string|null Local path to the cached toolchain root.
acquireCmakeToolchain
const acquireCmakeToolchain
Acquire a CMake toolchain, downloading and caching it if not already installed in the named cache.
| Parameter | Type | Description |
|---|---|---|
| version | string |
Returns: Promise<string> Local path to the toolchain root.
resolveCmakeToolchainVersion()
resolveCmakeToolchainVersion(version)
Resolve an explicit or default CMake toolchain version.
| Parameter | Type | Description |
|---|---|---|
| [version] | string |
Returns: string|null
defaultCmakeToolchainVersion()
defaultCmakeToolchainVersion()
Return the currently configured default CMake toolchain version.
Returns: string|null
defaultCmakeToolchain()
defaultCmakeToolchain()
Return the currently configured default CMake toolchain target handle.
Returns: object|null