mirror of
https://github.com/coder3101/protols.git
synced 2025-12-23 05:36:51 +00:00
This is a result of a small investigation into how to make protols work out of the box with the well-known protobuf types, even though it does not ship them. See https://github.com/NixOS/nixpkgs/pull/465302. The idea is to be able to configure, in compile time, a lowest-priority include path that a distro package could set to make sure, without compromising other sources of include paths, that protols can find the well-known types even when `pkg-config` and `protobuf` are missing from the environment and no paths have been manually configured via CLI or settings. Please advise on the best name for the environment variable.
11 lines
285 B
Rust
11 lines
285 B
Rust
use std::path::Path;
|
|
|
|
fn main() {
|
|
if let Some(path) = option_env!("FALLBACK_INCLUDE_PATH") {
|
|
let path = Path::new(path);
|
|
assert!(
|
|
path.is_absolute(),
|
|
"Environment variable FALLBACK_INCLUDE_PATH must be absolute: {path:?}"
|
|
);
|
|
}
|
|
}
|