diff --git a/components/bluetooth/Cargo.toml b/components/bluetooth/Cargo.toml index 0d77e584ba1..6f203b72e96 100644 --- a/components/bluetooth/Cargo.toml +++ b/components/bluetooth/Cargo.toml @@ -12,10 +12,18 @@ path = "lib.rs" [dependencies] bitflags = "1.0" bluetooth_traits = {path = "../bluetooth_traits"} -device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]} embedder_traits = {path = "../embedder_traits"} ipc-channel = "0.11" log = "0.4" servo_config = {path = "../config"} servo_rand = {path = "../rand"} uuid = {version = "0.6", features = ["v4"]} + +[features] +disable-native-bluetooth = [] + +[target.'cfg(feature = "disable-native-bluetooth")'.dependencies] +device = {git = "https://github.com/servo/devices", default-features = false, features = ["bluetooth-test"]} + +[target.'cfg(not(feature = "disable-native-bluetooth"))'.dependencies] +device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]} diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index 30d09e76e5c..db1a2afb268 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -18,6 +18,7 @@ energy-profiling = ["profile_traits/energy-profiling"] debugmozjs = ["script/debugmozjs"] googlevr = ["webvr/googlevr"] js_backtrace = ["script/js_backtrace"] +disable-native-bluetooth = ["bluetooth/disable-native-bluetooth"] webrender_debugger = ["webrender/debugger"] oculusvr = ["webvr/oculusvr"] unstable = [ diff --git a/ports/servo/Cargo.toml b/ports/servo/Cargo.toml index 8c54307c03a..d4274652008 100644 --- a/ports/servo/Cargo.toml +++ b/ports/servo/Cargo.toml @@ -25,6 +25,7 @@ ProductName = "Servo" [features] default = ["unstable", "default-except-unstable"] default-except-unstable = ["webdriver", "max_log_level"] +disable-native-bluetooth = ["libservo/disable-native-bluetooth"] max_log_level = ["log/release_max_level_info"] webdriver = ["libservo/webdriver"] energy-profiling = ["libservo/energy-profiling"] diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index de9bf1b42cb..e85cdb09ed3 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -248,8 +248,10 @@ class MachCommands(CommandBase): if android: target = self.config["android"]["target"] - if magicleap and not target: - target = "aarch64-linux-android" + if magicleap: + features += ["disable-native-bluetooth"] + if not target: + target = "aarch64-linux-android" if target: if self.config["tools"]["use-rustup"]: