cargo_env.bzlAPI docs @0.2.4

@cargo_env.bzl//:cargo_env.bzl

re-export to allow syntax sugar: load("@cargo_env.bzl", "cargo_env")

Functions & Macros

env_wrapper
Parameters
*name
*binary
*environment
visibility
Default: None
kwargs

Rules

cargo_env

Generates a Cargo environment file for cargo builds.

An example of using this rule is:

cargo_env(
    name = "cargo_env",
    clang = "@llvm_toolchain_llvm//:bin/clang",
    include_directories = ["@my_library//:headers_directory"],
    libclang = "@llvm_toolchain_llvm//:lib/libclang.so",
    openssl_dir = "@openssl//:gen_dir",
    env_directories = {
        "SOME_PACKAGE_PATH": "@some_package//:source_files",
    },
)
AttributeTypeDescription
*namename

A unique name for this target.

clanglabel

The clang binary.

Default: None
env_directoriesdictionary: Strings → Label

Map of environment variable names to filegroup targets. The path will be the repo/package root of the target. Example: {"MY_LIB_PATH": "@my_lib//:source_files"}

Default: {}
include_directorieslist of labels

Include directories for C++ to find.

Default: []
libclanglabel

libclang shared library (libclang.so).

Default: None
openssl_dirlabel

The OpenSSL directory.

Default: None

@cargo_env.bzl//cargo_env:cargo_env.bzl

Generates a Cargo environment file and wrapper scripts for cargo builds using dependencies provided by Bazel.

Functions & Macros

env_wrapper
Parameters
*name
*binary
*environment
visibility
Default: None
kwargs

Rules

cargo_env

Generates a Cargo environment file for cargo builds.

An example of using this rule is:

cargo_env(
    name = "cargo_env",
    clang = "@llvm_toolchain_llvm//:bin/clang",
    include_directories = ["@my_library//:headers_directory"],
    libclang = "@llvm_toolchain_llvm//:lib/libclang.so",
    openssl_dir = "@openssl//:gen_dir",
    env_directories = {
        "SOME_PACKAGE_PATH": "@some_package//:source_files",
    },
)
AttributeTypeDescription
*namename

A unique name for this target.

clanglabel

The clang binary.

Default: None
env_directoriesdictionary: Strings → Label

Map of environment variable names to filegroup targets. The path will be the repo/package root of the target. Example: {"MY_LIB_PATH": "@my_lib//:source_files"}

Default: {}
include_directorieslist of labels

Include directories for C++ to find.

Default: []
libclanglabel

libclang shared library (libclang.so).

Default: None
openssl_dirlabel

The OpenSSL directory.

Default: None