From 62930df7fecf351ef30bc7710007a0b913672f77 Mon Sep 17 00:00:00 2001 From: Thijs Cadier Date: Tue, 2 Mar 2021 13:02:02 +0100 Subject: [PATCH] Move back to static linking --- .semaphore/semaphore.yml | 2 +- mongoc-sys/build.rs | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index def8321..53823ad 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -37,7 +37,7 @@ blocks: - docker-compose $COMPOSE_OPTIONS up -d --no-recreate # Install dependencies - docker-compose $COMPOSE_OPTIONS exec $CONTAINER_NAME apt-get update - - docker-compose $COMPOSE_OPTIONS exec $CONTAINER_NAME apt-get install -y cmake libssl-dev + - docker-compose $COMPOSE_OPTIONS exec $CONTAINER_NAME apt-get install -y cmake libssl-dev libsasl2-dev libicu-dev jobs: - name: Test commands: diff --git a/mongoc-sys/build.rs b/mongoc-sys/build.rs index daa2356..c631c43 100644 --- a/mongoc-sys/build.rs +++ b/mongoc-sys/build.rs @@ -58,11 +58,15 @@ fn main() { cmake.arg("-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF"); cmake.arg("-DENABLE_SSL=OPENSSL"); cmake.arg("-DENABLE_SASL=OFF"); - cmake.arg("-DENABLE_STATIC=OFF"); + cmake.arg("-DENABLE_STATIC=ON"); + cmake.arg("-DENABLE_BSON=ON"); + cmake.arg("-DENABLE_ENABLE_EXAMPLES=OFF"); cmake.arg("-DENABLE_TESTS=OFF"); + cmake.arg("-DENABLE_SHM_COUNTERS=OFF"); cmake.arg("-DWITH_PIC=ON"); cmake.arg("-DWITH_SNAPPY=OFF"); cmake.arg("-DWITH_ZLIB=ON"); + cmake.arg("-DENABLE_EXTRA_ALIGNMENT=OFF"); // Run in current dir cmake.arg("."); @@ -82,7 +86,9 @@ fn main() { // Output to Cargo println!("cargo:rustc-link-search=native={}/usr/local/lib", &out_dir.to_string_lossy()); - println!("cargo:rustc-link-lib=bson-1.0"); - println!("cargo:rustc-link-lib=mongoc-1.0"); + println!("cargo:rustc-link-lib=static=bson-static-1.0"); + println!("cargo:rustc-link-lib=static=mongoc-static-1.0"); + println!("cargo:rustc-link-lib=resolv"); + #[cfg(target_os = "linux")] println!("cargo:rustc-link-lib=icuuc"); } }