Generate cxx binding in build.rs

This commit is contained in:
topjohnwu
2023-05-19 15:16:54 -07:00
parent 57bd450798
commit 2bcf2e76f1
27 changed files with 169 additions and 49 deletions

View File

@@ -7,6 +7,9 @@ edition = "2021"
crate-type = ["staticlib"]
path = "lib.rs"
[build-dependencies]
cxx-gen = { path = "../external/cxx-rs/gen/lib" }
[dependencies]
base = { path = "../base" }
cxx = { path = "../external/cxx-rs" }

8
native/src/core/build.rs Normal file
View File

@@ -0,0 +1,8 @@
use crate::gen::gen_cxx_binding;
#[path = "../base/gen.rs"]
mod gen;
fn main() {
gen_cxx_binding("core-rs");
}

View File

@@ -10,8 +10,6 @@
#include <db.hpp>
#include <flags.h>
#include <core-rs.cpp>
#include "core.hpp"
using namespace std;