summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorAndrew Guschin <guschin.drew@gmail.com>2023-08-13 01:27:00 +0400
committerAndrew Guschin <guschin.drew@gmail.com>2023-08-13 06:00:02 -0500
commit58acff54b1cd64cb23b9d0b1a304eb9db768e3eb (patch)
tree87281f776e0015f218aadb5cbfdad43c66406342 /build.rs
Initial commit
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs29
1 files changed, 29 insertions, 0 deletions
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");
+}