From aaae03d7a87e613b70ca335bd849035ba3faf4b9 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Thu, 2 Feb 2017 15:30:16 -0800 Subject: [PATCH] Bug 1322769 - Add a "servo" feature; r=manishearth MozReview-Commit-ID: A9dNTxNkl39 --HG-- extra : rebase_source : b9d115025beb00d596d34ca8d414a69b8ea2ba07 extra : source : f142ed52978bfab6407c252b7c56c53d0c3fcecd --- config/rules.mk | 3 +++ toolkit/library/gtest/rust/Cargo.toml | 1 + toolkit/library/rust/Cargo.toml | 1 + toolkit/library/rust/shared/Cargo.toml | 3 ++- toolkit/library/rust/shared/lib.rs | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/rules.mk b/config/rules.mk index f896333aa3cd..38246c768484 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -919,6 +919,9 @@ endif ifdef MOZ_CARGO_SUPPORTS_FROZEN cargo_build_flags += --frozen endif +ifdef MOZ_STYLO +cargo_build_flags += --features=servo +endif cargo_build_flags += --manifest-path $(CARGO_FILE) ifdef BUILD_VERBOSE_LOG diff --git a/toolkit/library/gtest/rust/Cargo.toml b/toolkit/library/gtest/rust/Cargo.toml index d01731bc727e..719aa674e41a 100644 --- a/toolkit/library/gtest/rust/Cargo.toml +++ b/toolkit/library/gtest/rust/Cargo.toml @@ -7,6 +7,7 @@ description = "Testing code for libgkrust" [features] bindgen = ["gkrust-shared/bindgen"] +servo = ["gkrust-shared/servo"] [dependencies] mp4parse-gtest = { path = "../../../../dom/media/gtest" } diff --git a/toolkit/library/rust/Cargo.toml b/toolkit/library/rust/Cargo.toml index 09444803fa0d..1ba190a7b39c 100644 --- a/toolkit/library/rust/Cargo.toml +++ b/toolkit/library/rust/Cargo.toml @@ -7,6 +7,7 @@ description = "Rust code for libxul" [features] bindgen = ["gkrust-shared/bindgen"] +servo = ["gkrust-shared/servo"] [dependencies] gkrust-shared = { path = "shared" } diff --git a/toolkit/library/rust/shared/Cargo.toml b/toolkit/library/rust/shared/Cargo.toml index 19b61d7a1561..dcca4578bde3 100644 --- a/toolkit/library/rust/shared/Cargo.toml +++ b/toolkit/library/rust/shared/Cargo.toml @@ -6,7 +6,7 @@ license = "MPL-2.0" description = "Shared Rust code for libxul" [dependencies] -geckoservo = { path = "../../../../servo/ports/geckolib" } +geckoservo = { path = "../../../../servo/ports/geckolib", optional = true } mp4parse_capi = { path = "../../../../media/libstagefright/binding/mp4parse_capi" } nsstring = { path = "../../../../xpcom/rust/nsstring" } rust_url_capi = { path = "../../../../netwerk/base/rust-url-capi" } @@ -14,6 +14,7 @@ rust_url_capi = { path = "../../../../netwerk/base/rust-url-capi" } [features] default = [] bindgen = ["geckoservo/bindgen"] +servo = ["geckoservo"] [lib] path = "lib.rs" diff --git a/toolkit/library/rust/shared/lib.rs b/toolkit/library/rust/shared/lib.rs index 838b9f379d5b..c26c8e227f23 100644 --- a/toolkit/library/rust/shared/lib.rs +++ b/toolkit/library/rust/shared/lib.rs @@ -2,6 +2,9 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#[cfg(feature="servo")] +extern crate geckoservo; + extern crate mp4parse_capi; extern crate nsstring; extern crate rust_url_capi;