Skip to content

Commit

Permalink
Patches to make xi work better on Fuchsia
Browse files Browse the repository at this point in the history
The debug plugins are disabled (with #cfg) on Fuchsia. Also, add
BUILD.gn build rules, so the core can be built using GN rather than
pulled in as a third-party dependency.
  • Loading branch information
raphlinus authored and trishume committed Jun 19, 2017
1 parent b46cb0d commit 3f1cc43
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
Empty file added rust/BUILD.gn
Empty file.
9 changes: 9 additions & 0 deletions rust/core-lib/BUILD.gn
@@ -0,0 +1,9 @@
import("//build/rust/rust_library.gni")

rust_library("xi_core_lib") {
deps = [
"//rust/xi-editor/rust/rpc:xi_rpc",
"//rust/xi-editor/rust/rope:xi_rope",
"//rust/xi-editor/rust/unicode:xi_unicode",
]
}
6 changes: 6 additions & 0 deletions rust/core-lib/src/plugins/manifest.rs
Expand Up @@ -23,6 +23,7 @@ use syntax::SyntaxDefinition;
static PLUGIN_DIR: &'static str = "XI_PLUGIN_DIR";

// example plugins. Eventually these should be loaded from disk.
#[cfg(not(target_os = "fuchsia"))]
pub fn debug_plugins() -> Vec<PluginDescription> {
use self::PluginActivation::*;
use self::PluginScope::*;
Expand Down Expand Up @@ -60,6 +61,11 @@ pub fn debug_plugins() -> Vec<PluginDescription> {
.collect::<Vec<_>>()
}

#[cfg(target_os = "fuchsia")]
pub fn debug_plugins() -> Vec<PluginDescription> {
Vec::new()
}

/// Describes attributes and capabilities of a plugin.
///
/// Note: - these will eventually be loaded from manifest files.
Expand Down
5 changes: 5 additions & 0 deletions rust/rope/BUILD.gn
@@ -0,0 +1,5 @@
import("//build/rust/rust_library.gni")

rust_library("xi_rope") {

}
5 changes: 5 additions & 0 deletions rust/rpc/BUILD.gn
@@ -0,0 +1,5 @@
import("//build/rust/rust_library.gni")

rust_library("xi_rpc") {

}
5 changes: 5 additions & 0 deletions rust/unicode/BUILD.gn
@@ -0,0 +1,5 @@
import("//build/rust/rust_library.gni")

rust_library("xi_unicode") {

}

0 comments on commit 3f1cc43

Please sign in to comment.