/* * A safe, Rust-native binding for the SWORD library * Copyright (C) 2025 Gregory Hellings * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ use system_deps; fn main() { let sources = vec!["mgr", "module", "versekey", "versification"]; let deps = system_deps::Config::new().probe().unwrap(); let mut build = cxx_build::bridge("src/cxx/mod.rs"); for src in sources { build.file(&format!("src/cxx/{}.cc", src)); println!("cargo:rerun-if-changed=src/cxx/{}.cc", src); println!("cargo:rerun-if-changed=src/cxx/{}.h", src); } build .includes(deps.all_include_paths()) .cpp_link_stdlib("stdc++") .flag("-Os") .compile("sword_rs"); println!("cargo:rerun-if-changed=src/cxx/mod.rs"); println!("cargo:rustc-link-lib=sword"); }