build.rs 901 B

123456789101112131415161718192021222324252627282930313233
  1. // -*- coding: utf-8 -*-
  2. //
  3. // Copyright (C) 2024 Michael Büsch <m@bues.ch>
  4. //
  5. // Licensed under the Apache License version 2.0
  6. // or the MIT license, at your option.
  7. // SPDX-License-Identifier: Apache-2.0 OR MIT
  8. #![forbid(unsafe_code)]
  9. use build_target::{target_arch, target_os, Arch, Os};
  10. fn main() {
  11. let arch = target_arch().expect("Failed to get build target architecture");
  12. let os = target_os().expect("Failed to get build target OS");
  13. println!("cargo:rustc-check-cfg=cfg(has_seccomp_support)");
  14. match os {
  15. Os::Linux | Os::Android => {
  16. match arch {
  17. // This is what `seccompiler` currently supports:
  18. Arch::X86_64 | Arch::AARCH64 => {
  19. println!("cargo:rustc-cfg=has_seccomp_support");
  20. }
  21. _ => (),
  22. }
  23. }
  24. _ => (),
  25. }
  26. }
  27. // vim: ts=4 sw=4 expandtab