Skip to main content

sp1_core_executor/
build.rs

1/// Based on architecture & feature configurations, choose between
2/// native executor and portable executor.
3#[allow(clippy::print_stdout)]
4pub fn detect_executor() {
5    assert!(std::env::var("OUT_DIR").is_ok(), "detect_executor is not run inside build script!");
6
7    #[cfg(all(target_arch = "x86_64", target_endian = "little", target_os = "linux",))]
8    println!("cargo:rustc-cfg=sp1_native_executor_available");
9
10    #[cfg(all(
11        target_arch = "x86_64",
12        target_endian = "little",
13        target_os = "linux",
14        not(feature = "profiling")
15    ))]
16    println!("cargo:rustc-cfg=sp1_use_native_executor");
17
18    #[cfg(not(all(
19        target_arch = "x86_64",
20        target_endian = "little",
21        target_os = "linux",
22        not(feature = "profiling")
23    )))]
24    println!("cargo:rustc-cfg=sp1_use_portable_executor");
25}