ClickHouse/rust/skim/build.rs.in
Azat Khuzhin 72d102d94c Fix rust modules rebuild (previously ignores changes in cargo config.toml)
This leads to the problem when you switch compiler flags, for example:

    $ cmake -DSANITIZE=memory ..
    $ ninja
    $ cmake -DSANITIZE= ..
    $ ninja

And this leads to:

    ld.lld-15: error: undefined symbol: __msan_init
    >>> referenced by lib.rs.cc
    >>>               lib.rs.o:(msan.module_ctor) in archive rust/skim/RelWithDebInfo/lib_ch_rust_skim_rust.a

Reported-by: @alexey-milovidov
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-12-27 10:35:50 +01:00

10 lines
283 B
Rust

fn main() {
let mut build = cxx_build::bridge("src/lib.rs");
for flag in "@RUST_CXXFLAGS@".split(' ') {
build.flag(flag);
}
build.compile("skim");
println!("cargo:rerun-if-changed=src/lib.rs");
println!("cargo:rerun-if-changed=.cargo/config.toml");
}