From 5a98962c15057442d19ccc727b87c3de41183d97 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 12 Oct 2022 12:16:37 +0200 Subject: [PATCH 1/3] Use `cargo rustc` to build Fornjot models This provides more flexibility and the potential for making it easier for the user to specify models. --- crates/fj-host/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-host/src/lib.rs b/crates/fj-host/src/lib.rs index f3d3847bf..c0d227fd1 100644 --- a/crates/fj-host/src/lib.rs +++ b/crates/fj-host/src/lib.rs @@ -90,7 +90,7 @@ impl Model { let mut command_root = Command::new("cargo"); let command = command_root - .arg("build") + .arg("rustc") .args(["--manifest-path", &manifest_path]); let cargo_output = command.output()?; From ccdc4bdeeb47d0c114a051a45396060fad177e9a Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 12 Oct 2022 12:19:01 +0200 Subject: [PATCH 2/3] Explicitly specify crate type when compiling model This removes the need for specifying the crate type in the model's `Cargo.toml`. --- crates/fj-host/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/fj-host/src/lib.rs b/crates/fj-host/src/lib.rs index c0d227fd1..57c133714 100644 --- a/crates/fj-host/src/lib.rs +++ b/crates/fj-host/src/lib.rs @@ -91,7 +91,8 @@ impl Model { let command = command_root .arg("rustc") - .args(["--manifest-path", &manifest_path]); + .args(["--manifest-path", &manifest_path]) + .args(["--crate-type", "cdylib"]); let cargo_output = command.output()?; let exit_status = cargo_output.status; From 2a9caa425a818d521c2c2c8eeb85e65f2a763796 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 12 Oct 2022 12:19:48 +0200 Subject: [PATCH 3/3] Remove redundant info from model `Cargo.toml`s --- models/cuboid/Cargo.toml | 3 --- models/spacer/Cargo.toml | 3 --- models/star/Cargo.toml | 3 --- models/test/Cargo.toml | 3 --- 4 files changed, 12 deletions(-) diff --git a/models/cuboid/Cargo.toml b/models/cuboid/Cargo.toml index bb653d0c8..42746d61c 100644 --- a/models/cuboid/Cargo.toml +++ b/models/cuboid/Cargo.toml @@ -3,8 +3,5 @@ name = "cuboid" version = "0.1.0" edition = "2021" -[lib] -crate-type = ["cdylib"] - [dependencies.fj] path = "../../crates/fj" diff --git a/models/spacer/Cargo.toml b/models/spacer/Cargo.toml index 1eaf19c6a..a83c4c299 100644 --- a/models/spacer/Cargo.toml +++ b/models/spacer/Cargo.toml @@ -3,8 +3,5 @@ name = "spacer" version = "0.1.0" edition = "2021" -[lib] -crate-type = ["cdylib"] - [dependencies.fj] path = "../../crates/fj" diff --git a/models/star/Cargo.toml b/models/star/Cargo.toml index c5c2d4efd..0279bef41 100644 --- a/models/star/Cargo.toml +++ b/models/star/Cargo.toml @@ -3,8 +3,5 @@ name = "star" version = "0.1.0" edition = "2021" -[lib] -crate-type = ["cdylib"] - [dependencies.fj] path = "../../crates/fj" diff --git a/models/test/Cargo.toml b/models/test/Cargo.toml index dd9fa6bc0..c70a94aa4 100644 --- a/models/test/Cargo.toml +++ b/models/test/Cargo.toml @@ -7,8 +7,5 @@ homepage = "https://www.fornjot.app/" repository = "https://github.com/hannobraun/fornjot" license = "0BSD" -[lib] -crate-type = ["cdylib"] - [dependencies.fj] path = "../../crates/fj"