diff options
author | Mike Harris <harmic@gmail.com> | 2021-02-02 03:58:47 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 16:58:47 +0000 |
commit | 459296d0e21fbbfd77a60a8341194e5c39a66d6f (patch) | |
tree | 8e80ceedede29c28af819fe18bb2a2e15879c657 /libssh2-sys/build.rs | |
parent | 1fcf8d38d401b230561863d1e40fd41d76e8601c (diff) | |
download | ssh2-rs-459296d0e21fbbfd77a60a8341194e5c39a66d6f.zip |
Expose libssh2_trace function (#209)
* Expose libssh2_trace function and associated
constants, to allow enabling libssh2 trace
output.
* set LIBSSH2_WIN32 on windows build so that
gettimeofday replacement will be compiled.
* libssh2_trace actually returns int, even though
the documentation says it returns void. This
was causing systest to fail.
Changed the FFI to match the C function.
Co-authored-by: eharmic <michael.harris@ericsson.com>
Diffstat (limited to 'libssh2-sys/build.rs')
-rw-r--r-- | libssh2-sys/build.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs index 2150148..0ec2073 100644 --- a/libssh2-sys/build.rs +++ b/libssh2-sys/build.rs @@ -39,6 +39,7 @@ fn main() { } let target = env::var("TARGET").unwrap(); + let profile = env::var("PROFILE").unwrap(); let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap()); let mut cfg = cc::Build::new(); @@ -91,6 +92,7 @@ fn main() { if target.contains("windows") { cfg.include("libssh2/win32"); cfg.define("LIBSSH2_WINCNG", None); + cfg.define("LIBSSH2_WIN32", None); cfg.file("libssh2/src/wincng.c"); } else { cfg.flag("-fvisibility=hidden"); @@ -108,6 +110,7 @@ fn main() { cfg.define("HAVE_LIBCRYPT32", None); cfg.define("HAVE_EVP_AES_128_CTR", None); cfg.define("HAVE_POLL", None); + cfg.define("HAVE_GETTIMEOFDAY", None); cfg.file("libssh2/src/openssl.c"); @@ -126,6 +129,11 @@ fn main() { cfg.define("LIBSSH2_DH_GEX_NEW", None); cfg.define("LIBSSH2_HAVE_ZLIB", None); + + if profile.contains("debug") { + cfg.define("LIBSSH2DEBUG", None); + } + println!("cargo:rerun-if-env-changed=DEP_Z_INCLUDE"); if let Some(path) = env::var_os("DEP_Z_INCLUDE") { cfg.include(path); |