Files
sorsfonalak/crates/swisseph-sys/build.rs
T
fecoandClaude Opus 5.5 3a84110565 Add horoscope-api, synastry, and backend services
- horoscope-api: Swiss Ephemeris natal charts, timezone/place resolution,
  POST /v1/natal and POST /v1/synastry
- backend: users with roles, email/password and Google login, saved charts,
  synastries and invites, analyses with credit ledger, public shares, admin
- shared crates: astro-engine, db (migrations), horoscope-client, service-kit
- docker-compose with postgres, legacy Java project for reference

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-15 10:25:35 +00:00

45 lines
1.2 KiB
Rust

use std::path::PathBuf;
/// Library objects as listed in the upstream Makefile (SWEOBJ).
const SOURCES: &[&str] = &[
"swedate.c",
"swehouse.c",
"swejpl.c",
"swemmoon.c",
"swemplan.c",
"sweph.c",
"swephlib.c",
"swecl.c",
"swehel.c",
];
fn main() {
let dir = std::env::var_os("SWISSEPH_SRC_DIR")
.map(PathBuf::from)
.unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../vendor/swisseph"));
if !dir.join("sweph.c").exists() {
panic!(
"Swiss Ephemeris sources not found in {}. Run scripts/fetch-deps.sh first \
(or set SWISSEPH_SRC_DIR).",
dir.display()
);
}
let mut build = cc::Build::new();
build
.include(&dir)
// Globals are shared between threads; the Rust side serializes access.
.define("TLSOFF", None)
.opt_level(2)
.warnings(false);
for src in SOURCES {
let path = dir.join(src);
println!("cargo:rerun-if-changed={}", path.display());
build.file(path);
}
build.compile("swe");
println!("cargo:rerun-if-env-changed=SWISSEPH_SRC_DIR");
println!("cargo:rustc-link-lib=m");
}