fn main() { println!("cargo:rerun-if-changed=build.rs"); let mut builder = cc::Build::new(); builder.cpp(true) .files( vec![ "klogger/internal/console_appender.cpp", "klogger/internal/file_appender.cpp", "klogger/internal/file_name.cpp", "klogger/internal/http_appender.cpp", "klogger/internal/logger_factory.cpp", "klogger/internal/logger_impl.cpp", "klogger/internal/mode.cpp", "klogger/internal/pattern.cpp", "klogger/internal/scope_lock.cpp", "klogger/internal/tcp_appender.cpp", "klogger/internal/util.cpp", "rust/c_wrapper.cpp", ]) .includes(vec![".", "klogger", "klogger/interface", "klogger/internal"]) .define("RUST_WRAPPER", "1"); if cfg!(target_os = "linux") { builder.flag_if_supported("-std=c++17"); } else if cfg!(target_env = "msvc") { builder.define("WIN32_LEAN_AND_MEAN", "1") .flag_if_supported("/std:c++17"); } builder.compile("klogger"); }