• Home
  • Raw
  • Download

Lines Matching +full:linux +full:- +full:headers

1 // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
10 // Platform-Specific Instructions: Regenerating gRPC Bindings for Windows
12 // If you need to manually update the 'android/grpc-bindings.rs' file on Windows,
16 // - Download and install the pre-built LLVM binaries from:
18 // - Update the `LIBCLANG_PATH` environment variable to point to the 'bin'
22 // - Set the `GRPCIO_SYS_GRPC_INCLUDE_PATH` environment variable to the
26 // - Run the following Cargo command to regenerate the bindings:
27 // `cargo build --features _gen-bindings`
29 include!("../link-deps.rs");
31 fn get_env(name: &str) -> Option<String> { in get_env()
32 println!("cargo:rerun-if-env-changed={name}"); in get_env()
42 // Generate the bindings to grpc C-core.
43 // Try to disable the generation of platform-related bindings.
45 feature = "_gen-bindings",
47 any(target_os = "linux", target_os = "macos"),
55 config = config.clang_arg("-DGRPC_SYS_SECURE"); in bindgen_grpc()
59 config = config.clang_arg("-D _WIN32_WINNT=0x600"); in bindgen_grpc()
63 let mut headers = Vec::new(); in bindgen_grpc() localVariable
65 let dent = result.expect("Error happened when search headers"); in bindgen_grpc()
69 let mut file = fs::File::open(dent.path()).expect("couldn't open headers"); in bindgen_grpc()
74 headers.push(String::from(dent.path().to_str().unwrap())); in bindgen_grpc()
79 headers.sort(); in bindgen_grpc()
80 for path in headers { in bindgen_grpc()
84 println!("cargo:rerun-if-env-changed=TEST_BIND"); in bindgen_grpc()
89 .clang_arg("-xc++") in bindgen_grpc()
90 .clang_arg("-I./grpc/include") in bindgen_grpc()
91 .clang_arg("-std=c++11") in bindgen_grpc()
105 // Block all system headers. in bindgen_grpc()
126 // need to be updated by default unless the _gen-bindings feature is specified.
130 "x86_64-unknown-linux-gnu" in config_binding_path()
131 | "x86_64-unknown-linux-musl" in config_binding_path()
132 | "aarch64-unknown-linux-musl" in config_binding_path()
133 | "aarch64-unknown-linux-gnu" in config_binding_path()
134 | "x86_64-apple-darwin" in config_binding_path()
135 | "aarch64-apple-darwin" => { in config_binding_path()
136 // Cargo treats nonexistent files changed, so we only emit the rerun-if-changed in config_binding_path()
137 // directive when we expect the target-specific pre-generated binding file to be in config_binding_path()
139 println!("cargo:rerun-if-changed=bindings/bindings.rs"); in config_binding_path()
147 .join("grpc-bindings.rs"), in config_binding_path()
149 #[cfg(feature = "_gen-bindings")] in config_binding_path()
164 "cargo:rustc-env=BINDING_PATH={}", in config_binding_path()
170 println!("cargo:rerun-if-changed=grpc_wrap.cc"); in main()
171 println!("cargo:rerun-if-changed=grpc"); in main()