|
| 1 | +//! # The build script for cust_raw |
| 2 | +//! The build script for the cust_raw generates bindings for libraries in the |
| 3 | +//! CUDA SDK. The build scripts searches for the CUDA SDK by reading the |
| 4 | +//! `CUDA_PATH`, `CUDA_ROOT`, or `CUDA_TOOLKIT_ROOT_DIR` environment variables |
| 5 | +//! in that order. If none of these variables are set to a vaild CUDA Toolkit |
| 6 | +//! SDK path, the build script will attempt to search for any SDK in the |
| 7 | +//! default installation locations for the current platform. |
| 8 | +//! |
| 9 | +//! ## Bindings |
| 10 | +//! You can control which bindings are generated by enabling features in your |
| 11 | +//! `Cargo.toml` file. By default, only the CUDA driver API is enabled. |
| 12 | +//! |
| 13 | +//! ## Cargo metadata |
| 14 | +//! The build script emits Cargo metadata that can be used by dependent crates |
| 15 | +//! in their build script. You can read this metadata via `DEP_CUDA_*` |
| 16 | +//! environment variables. The current list of metadata includes: |
| 17 | +//! |
| 18 | +//! - `DEP_CUDA_ROOT`: The root directory of the CUDA SDK installation used. |
| 19 | +//! - `DEP_CUDA_DRIVER_VERSION`: The version of the CUDA driver API found (e.g: `12080`). |
| 20 | +//! - `DEP_CUDA_DRIVER_VERSION_MAJOR`: The major version of the CUDA driver API found. |
| 21 | +//! - `DEP_CUDA_DRIVER_VERSION_MINOR`: The minor version of the CUDA driver API found. |
| 22 | +//! - `DEP_CUDA_RUNTIME_VERSION`: The version of the CUDA runtime API found. |
| 23 | +//! - `DEP_CUDA_INCLUDES`: The include directories for the CUDA SDK, separated by platform-specific path separator. |
| 24 | +//! - `DEP_CUDA_NVVM_INCLUDES`: The include directories for NVVM headers, separated by platform-specific path separator. |
| 25 | +//! |
| 26 | +
|
1 | 27 | use std::env;
|
2 | 28 | use std::fs;
|
3 | 29 | use std::path;
|
@@ -29,8 +55,8 @@ fn main() {
|
29 | 55 | let metadata_nvvm_include = env::join_paths(sdk.nvvm_include_paths())
|
30 | 56 | .map(|s| s.to_string_lossy().to_string())
|
31 | 57 | .expect("Failed to build metadata for nvvm_include.");
|
32 |
| - println!("cargo::metadata=cuda_include={}", metadata_cuda_include); |
33 |
| - println!("cargo::metadata=nvvm_include={}", metadata_nvvm_include); |
| 58 | + println!("cargo::metadata=includes={}", metadata_cuda_include); |
| 59 | + println!("cargo::metadata=nvvm_includes={}", metadata_nvvm_include); |
34 | 60 | // Re-run build script conditions.
|
35 | 61 | println!("cargo::rerun-if-changed=build");
|
36 | 62 | for e in sdk.related_cuda_envs() {
|
|
0 commit comments