Skip to content

Commit

Permalink
build: use repository to detect public or private repo (#32)
Browse files Browse the repository at this point in the history
in case private and public crate use the same name
  • Loading branch information
fouge authored Jun 12, 2024
1 parent 559b27e commit 93e32a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ fn main() {
// NOTE: We cannot use `CARGO_MANIFEST_DIR`, because protoc doesn't work well with
// absolute paths.
#[allow(clippy::eq_op)]
let is_public = env!("CARGO_PKG_NAME") == "orb-messages";
let is_public =
env!("CARGO_PKG_REPOSITORY") == "https://github.com/worldcoin/orb-messages";
let (messages_dir, priv_dir) = if is_public {
println!("cargo:warning=Be aware that private definitions are stubbed out when building the public crate.");

Expand Down

0 comments on commit 93e32a2

Please sign in to comment.