• Home
  • Raw
  • Download

Lines Matching +full:prelude +full:- +full:submodule

1 // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
6 use std::io::prelude::*;
15 fn grpc_version() -> &'static str { in grpc_version()
19 label.split('-').next().unwrap() in grpc_version()
22 include!("link-deps.rs");
24 fn probe_library(library: &str, cargo_metadata: bool) -> Library { in probe_library()
31 Err(e) => panic!("can't find library {} via pkg-config: {:?}", library, e), in probe_library()
40 "grpc/third_party/abseil-cpp", in prepare_grpc()
47 "Can't find module {}. You need to run `git submodule \ in prepare_grpc()
48 update --init --recursive` first to build the project.", in prepare_grpc()
55 fn is_directory_empty<P: AsRef<Path>>(p: P) -> Result<bool, io::Error> { in is_directory_empty()
60 fn trim_start<'a>(s: &'a str, prefix: &str) -> Option<&'a str> { in trim_start()
88 // See https://gitlab.kitware.com/cmake/cmake/-/issues/18959. in clean_up_stale_cache()
137 let mut f = File::create("link-deps.rs").unwrap(); in list_packages()
139 b"/// Following two arrays are generated by running pkg-config manually. We can in list_packages()
140 /// also choose to run pkg-config at build time, but it will requires pkg-config in list_packages()
162 config.cxxflag("-stdlib=libc++"); in build_grpc()
163 println!("cargo:rustc-link-lib=resolv"); in build_grpc()
170 println!("cargo:rustc-link-lib=framework=CoreFoundation"); in build_grpc()
184 // Cross-compile support for iOS in build_grpc()
186 "aarch64-apple-ios" => { in build_grpc()
191 "armv7-apple-ios" => { in build_grpc()
196 "armv7s-apple-ios" => { in build_grpc()
201 "i386-apple-ios" => { in build_grpc()
206 "x86_64-apple-ios" => { in build_grpc()
221 config.define("gRPC_INSTALL", cfg!(feature = "_list-package").to_string()); in build_grpc()
238 if cfg!(feature = "openssl-vendored") { in build_grpc()
245 if cfg!(feature = "no-omit-frame-pointer") { in build_grpc()
247 .cflag("-fno-omit-frame-pointer") in build_grpc()
248 .cxxflag("-fno-omit-frame-pointer"); in build_grpc()
250 // Uses zlib from libz-sys. in build_grpc()
252 if !cfg!(feature = "_list-package") { in build_grpc()
268 "cargo:rustc-link-search=native={}", in build_grpc()
274 if cfg!(feature = "_list-package") { in build_grpc()
284 println!("cargo:rustc-link-lib=static={l}"); in build_grpc()
288 if cfg!(feature = "openssl") && !cfg!(feature = "openssl-vendored") { in build_grpc()
291 println!("cargo:rustc-link-lib=static=ssl"); in build_grpc()
292 println!("cargo:rustc-link-lib=static=crypto"); in build_grpc()
323 println!("cargo:rustc-link-search=native={}", libdir); in figure_systemd_path()
324 println!("cargo:rustc-link-lib={}", libname); in figure_systemd_path()
339 "cargo:rustc-link-search=native={}", in figure_ssl_path()
351 println!("cargo:rustc-link-lib=ssl"); in figure_ssl_path()
352 println!("cargo:rustc-link-lib=crypto"); in figure_ssl_path()
364 "cargo:rustc-link-search=native={}", in build_boringssl()
372 // cmake script expect libz.a being under ${DEP_Z_ROOT}/lib, but libz-sys crate put it in setup_libz()
381 println!("cargo:rustc-link-search=native={zlib_root}/build"); in setup_libz()
382 println!("cargo:rustc-link-search=native={zlib_root}/lib"); in setup_libz()
386 fn get_env(name: &str) -> Option<String> { in get_env()
387 println!("cargo:rerun-if-env-changed={name}"); in get_env()
397 // Generate the bindings to grpc C-core.
398 // Try to disable the generation of platform-related bindings.
400 feature = "_gen-bindings",
410 config = config.clang_arg("-DGRPC_SYS_SECURE"); in bindgen_grpc()
414 config = config.clang_arg("-D _WIN32_WINNT=0x600"); in bindgen_grpc()
439 println!("cargo:rerun-if-env-changed=TEST_BIND"); in bindgen_grpc()
444 .clang_arg("-xc++") in bindgen_grpc()
445 .clang_arg("-I./grpc/include") in bindgen_grpc()
446 .clang_arg("-std=c++11") in bindgen_grpc()
481 // need to be updated by default unless the _gen-bindings feature is specified.
486 "x86_64-unknown-linux-gnu" in config_binding_path()
487 | "x86_64-unknown-linux-musl" in config_binding_path()
488 | "aarch64-unknown-linux-musl" in config_binding_path()
489 | "aarch64-unknown-linux-gnu" in config_binding_path()
490 | "x86_64-apple-darwin" in config_binding_path()
491 | "aarch64-apple-darwin" => { in config_binding_path()
492 // Cargo treats nonexistent files changed, so we only emit the rerun-if-changed in config_binding_path()
493 // directive when we expect the target-specific pre-generated binding file to be in config_binding_path()
495 println!("cargo:rerun-if-changed=bindings/bindings.rs"); in config_binding_path()
501 _ => PathBuf::from(env::var("OUT_DIR").unwrap()).join("grpc-bindings.rs"), in config_binding_path()
505 feature = "_gen-bindings", in config_binding_path()
525 "cargo:rustc-env=BINDING_PATH={}", in config_binding_path()
531 println!("cargo:rerun-if-changed=grpc_wrap.cc"); in main()
532 println!("cargo:rerun-if-changed=grpc"); in main()
561 cc.flag("-std=c++11"); in main()