blob: e61c1af34d05bea4ec4fdb32a994190d78078b82 [file] [log] [blame]
Brian Silverman4e662aa2022-05-11 23:10:19 -07001// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9fn main() -> miette::Result<()> {
10 // It's necessary to use an absolute path here because the
11 // C++ codegen and the macro codegen appears to be run from different
12 // working directories.
13 let path = std::path::PathBuf::from("s2geometry/src");
14 let path2 = std::path::PathBuf::from("src");
15 let mut b = autocxx_build::Builder::new("src/main.rs", &[&path, &path2]).build()?;
16 b.flag_if_supported("-std=c++14")
17 .compile("autocxx-s2-example");
18 println!("cargo:rerun-if-changed=src/main.rs");
19 Ok(())
20}