From 2602f4845292406b0dbeace25b9aaf40587231c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Crozet=20S=C3=A9bastien?= Date: Thu, 1 Apr 2021 11:40:27 +0200 Subject: [PATCH 1/2] Fix compilation when only the `serde-serialize` feature of nalgebra is enabled. --- .github/workflows/nalgebra-ci-build.yml | 2 ++ Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nalgebra-ci-build.yml b/.github/workflows/nalgebra-ci-build.yml index 83a56435..e4791f97 100644 --- a/.github/workflows/nalgebra-ci-build.yml +++ b/.github/workflows/nalgebra-ci-build.yml @@ -34,6 +34,8 @@ jobs: run: cargo build --no-default-features; - name: Build (default features) run: cargo build; + - name: Build --features serde-serialize + run: cargo build --features serde-serialize - name: Build --all-features run: cargo build --all-features; - name: Build nalgebra-glm diff --git a/Cargo.toml b/Cargo.toml index 84f5eea1..411c3ad3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,10 +23,10 @@ path = "src/lib.rs" [features] default = [ "std" ] -std = [ "matrixmultiply", "simba/std" ] +std = [ "matrixmultiply", "simba/std", "serde/std" ] sparse = [ ] debug = [ "approx/num-complex", "rand" ] -alloc = [ ] +alloc = [ "serde/alloc" ] io = [ "pest", "pest_derive" ] compare = [ "matrixcompare-core" ] libm = [ "simba/libm" ] From 4e5b32a3fadd27692603b32cf978fd112b853d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Crozet=20S=C3=A9bastien?= Date: Thu, 1 Apr 2021 11:53:19 +0200 Subject: [PATCH 2/2] Don't enable the `serde/alloc` feature when `alloc` is enabled. It looks like serde still pulls std when only `alloc` is selected. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 411c3ad3..2b99f0a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ default = [ "std" ] std = [ "matrixmultiply", "simba/std", "serde/std" ] sparse = [ ] debug = [ "approx/num-complex", "rand" ] -alloc = [ "serde/alloc" ] +alloc = [ ] io = [ "pest", "pest_derive" ] compare = [ "matrixcompare-core" ] libm = [ "simba/libm" ]