Files
sword_rs/build.rs
T

40 lines
1.4 KiB
Rust
Raw Normal View History

2025-06-30 01:35:39 -05:00
/*
* 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.
*
*/
2025-02-24 15:58:46 -06:00
use system_deps;
fn main() {
2025-06-29 22:04:56 -05:00
let sources = vec!["mgr", "module", "versekey", "versification"];
2025-02-24 15:58:46 -06:00
let deps = system_deps::Config::new().probe().unwrap();
2025-06-25 02:30:42 -05:00
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
2025-02-24 15:58:46 -06:00
.includes(deps.all_include_paths())
2025-02-24 20:55:06 -06:00
.cpp_link_stdlib("stdc++")
.flag("-Os")
2025-02-24 15:58:46 -06:00
.compile("sword_rs");
2025-02-25 14:55:39 -06:00
println!("cargo:rerun-if-changed=src/cxx/mod.rs");
2025-02-24 15:58:46 -06:00
println!("cargo:rustc-link-lib=sword");
}