|
|
|
@ -190,8 +190,9 @@ fn link_core_objects() {
|
|
|
|
|
let crate_path = env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
|
|
|
let build_path = format!("{}/../../build/unix", crate_path);
|
|
|
|
|
|
|
|
|
|
// List of object filenames to ignore in the `embed` directory.
|
|
|
|
|
// List of object filenames to ignore in the `embed` and `vendor` directory
|
|
|
|
|
let embed_blocklist = [OsStr::new("main_main.o")];
|
|
|
|
|
let vendor_blocklist = [OsStr::new("gen_context.o")];
|
|
|
|
|
|
|
|
|
|
// Collect all objects that the `core` library uses, and link it in. We have to
|
|
|
|
|
// make sure to avoid the object with the `_main` symbol, so we don't get any
|
|
|
|
@ -205,8 +206,14 @@ fn link_core_objects() {
|
|
|
|
|
cc.object(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for obj in glob::glob(&format!("{}/vendor/**/*.o", build_path)).unwrap() {
|
|
|
|
|
cc.object(obj.unwrap());
|
|
|
|
|
let obj = obj.unwrap();
|
|
|
|
|
if vendor_blocklist.contains(&obj.file_name().unwrap()) {
|
|
|
|
|
// Ignore.
|
|
|
|
|
} else {
|
|
|
|
|
cc.object(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compile all the objects into a static library and link it in automatically.
|
|
|
|
|