From 97ebccbb5b8aa08629957b0cfa44c3f95460dcdb Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 28 Jun 2024 16:47:19 +0200 Subject: [PATCH] fix(concrete-csprng): handle multi-valued `target_family` --- concrete-csprng/build.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/concrete-csprng/build.rs b/concrete-csprng/build.rs index e6c243c486..5a3939533e 100644 --- a/concrete-csprng/build.rs +++ b/concrete-csprng/build.rs @@ -36,12 +36,15 @@ impl FeatureRequirement { } } - let target_family = get_target_family_cfg(); + let target_families = get_target_family_cfgs(); if let Some(feature_req_target_family) = self.feature_req_target_family { - if feature_req_target_family != target_family { + if target_families + .split(',') + .all(|family| family != feature_req_target_family) + { panic!( - "Feature `{}` requires target_family `{}`, current cfg: `{}`", - self.feature_name, feature_req_target_family, target_family + "Feature `{}` requires target_family `{}`, current cfgs: `{}`", + self.feature_name, feature_req_target_family, target_families ) } } @@ -97,7 +100,7 @@ fn get_target_arch_cfg() -> String { env::var("CARGO_CFG_TARGET_ARCH").expect("CARGO_CFG_TARGET_ARCH is not set") } -fn get_target_family_cfg() -> String { +fn get_target_family_cfgs() -> String { env::var("CARGO_CFG_TARGET_FAMILY").expect("CARGO_CFG_TARGET_FAMILY is not set") }