|
@@ -16,7 +16,20 @@
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+use std::process::Command;
|
|
|
|
|
+
|
|
|
fn main() {
|
|
fn main() {
|
|
|
|
|
+ let output = Command::new("git")
|
|
|
|
|
+ .args(["rev-parse", "--short", "HEAD"])
|
|
|
|
|
+ .output();
|
|
|
|
|
+
|
|
|
|
|
+ if let Ok(output) = output {
|
|
|
|
|
+ if output.status.success() {
|
|
|
|
|
+ let commitish = String::from_utf8_lossy(&output.stdout);
|
|
|
|
|
+ println!("cargo:rustc-env=COMMITISH={}", commitish.trim());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "android" {
|
|
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "android" {
|
|
|
println!("cargo:rustc-link-search={}/sqlcipher", env!("CARGO_MANIFEST_DIR"));
|
|
println!("cargo:rustc-link-search={}/sqlcipher", env!("CARGO_MANIFEST_DIR"));
|
|
|
}
|
|
}
|