From 58acff54b1cd64cb23b9d0b1a304eb9db768e3eb Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Sun, 13 Aug 2023 01:27:00 +0400 Subject: Initial commit --- build.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 build.rs (limited to 'build.rs') diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..f9bb718 --- /dev/null +++ b/build.rs @@ -0,0 +1,29 @@ +use std::process::Command; + +fn main() { + Command::new("make") + .arg("-C") + .arg("nauty") + .arg("libnauty.a") + .status() + .unwrap(); + cc::Build::new() + .file("nauty/geng.c") + .file("nauty/geng-iter.c") + .flag("-O3") + .flag("-Wno-unused-parameter") + .flag("-Wno-sign-compare") + .flag("-Wno-unused-variable") + .flag("-Wno-unused-function") + .define("_XOPEN_SOURCE", None) + .define("MAXN", "WORDSIZE") + .define("WORDSIZE", "32") + .define("OUTPROC", "myoutproc") + .define("GENG_MAIN", "geng_main") + .compile("geng"); + + println!("cargo:rerun-if-changed=./nauty/geng.c"); + println!("cargo:rerun-if-changed=./nauty/geng-iter.c"); + println!("cargo:rustc-link-search=./nauty"); + println!("cargo:rustc-link-lib=static=nauty"); +} -- cgit v1.2.3