safemlx_sys/lib.rs
1#![allow(non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4#![allow(clippy::all)]
5
6include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
7
8#[cfg(all(feature = "metal", target_vendor = "apple"))]
9include!(concat!(env!("OUT_DIR"), "/embedded_metallib.rs"));
10
11/// Path to the uncompressed `mlx.metallib` build artifact.
12///
13/// Normal applications do not need this path: the compressed library is
14/// embedded automatically. This artifact remains available for diagnostics
15/// and explicit custom-library overrides. Set `SAFEMLX_METALLIB_OUTPUT_DIR`
16/// while building to export it to a different directory.
17#[cfg(all(feature = "metal", target_vendor = "apple"))]
18pub const MLX_METALLIB_PATH: &str = match option_env!("SAFEMLX_METALLIB_PATH") {
19 Some(path) => path,
20 None => "",
21};