From 6e8276d1d0bad7e592200d6082506dd428bf8226 Mon Sep 17 00:00:00 2001 From: technic93 Date: Sun, 17 Feb 2019 12:03:19 +0100 Subject: [PATCH 1/3] Clarify instruction for building with vcpkg Mention VCPKGRS_DYNAMIC environment variable. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 46912b2..d8b3ffd 100644 --- a/README.md +++ b/README.md @@ -128,8 +128,12 @@ You can adjust this behavior in a number of ways: * Installing the sqlite3 development packages will usually be all that is required, but the build helpers for [pkg-config](https://github.com/alexcrichton/pkg-config-rs) and [vcpkg](https://github.com/mcgoo/vcpkg-rs) have some additional configuration - options. The default when using vcpkg is to dynamically link. `vcpkg install sqlite3:x64-windows` will install the required library. - + options. The default when using vcpkg is to dynamically link, + which must be enabled by setting `VCPKGRS_DYNAMIC=1` environment variable before build. + `vcpkg install sqlite3:x64-windows` will install the required library. + +*Note:* to change the way `libsqlite3-sys` is built, you need to run `cargo clean libsqlite3-sys` first. + ### Binding generation We use [bindgen](https://crates.io/crates/bindgen) to generate the Rust From f702bc0797a2165a902811badfaca9503c4757f4 Mon Sep 17 00:00:00 2001 From: Alex Maystrenko Date: Sun, 24 Mar 2019 21:21:13 +0100 Subject: [PATCH 2/3] rebuild when VCPKGRS_DYNAMIC changes --- libsqlite3-sys/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libsqlite3-sys/build.rs b/libsqlite3-sys/build.rs index e91f8c6..1e5180a 100644 --- a/libsqlite3-sys/build.rs +++ b/libsqlite3-sys/build.rs @@ -132,6 +132,9 @@ mod build { if cfg!(target_os = "windows") { println!("cargo:rerun-if-env-changed=PATH"); } + if cfg!(all(feature = "vcpkg", target_env = "msvc")) { + println!("cargo:rerun-if-env-changed=VCPKGRS_DYNAMIC"); + } // Allow users to specify where to find SQLite. if let Ok(dir) = env::var(format!("{}_LIB_DIR", env_prefix())) { // Try to use pkg-config to determine link commands From 4d2f2c083341687273dcb12d57020acc325758da Mon Sep 17 00:00:00 2001 From: Alex Maystrenko Date: Sun, 24 Mar 2019 21:24:28 +0100 Subject: [PATCH 3/3] Remove note about rebuilding, because env change tracked automatically --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d8b3ffd..59d3b30 100644 --- a/README.md +++ b/README.md @@ -132,8 +132,6 @@ You can adjust this behavior in a number of ways: which must be enabled by setting `VCPKGRS_DYNAMIC=1` environment variable before build. `vcpkg install sqlite3:x64-windows` will install the required library. -*Note:* to change the way `libsqlite3-sys` is built, you need to run `cargo clean libsqlite3-sys` first. - ### Binding generation We use [bindgen](https://crates.io/crates/bindgen) to generate the Rust