Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split simpleservo into 3 crates for rust, c and jni apis
- Loading branch information
1 parent
4434445
commit 16a00a1
Showing
13 changed files
with
174 additions
and
105 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
use gl_generator::{Api, Fallbacks, Profile, Registry}; | ||
use std::env; | ||
use std::fs::File; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
let target = env::var("TARGET").unwrap(); | ||
// Generate GL bindings | ||
// For now, we only support EGL, and only on Windows and Android. | ||
if target.contains("android") || target.contains("windows") { | ||
let dest = env::var("OUT_DIR").unwrap(); | ||
let mut file = File::create(&Path::new(&dest).join("egl_bindings.rs")).unwrap(); | ||
if target.contains("android") { | ||
Registry::new(Api::Egl, (1, 5), Profile::Core, Fallbacks::All, []) | ||
.write_bindings(gl_generator::StaticStructGenerator, &mut file) | ||
.unwrap(); | ||
} | ||
if target.contains("windows") { | ||
Registry::new(Api::Egl, (1, 5), Profile::Core, Fallbacks::All, []) | ||
.write_bindings(gl_generator::StructGenerator, &mut file) | ||
.unwrap(); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[package] | ||
name = "simpleservo_capi" | ||
version = "0.0.1" | ||
authors = ["The Servo Project Developers"] | ||
license = "MPL-2.0" | ||
edition = "2018" | ||
publish = false | ||
|
||
[lib] | ||
name = "simpleservo" | ||
crate-type = ["cdylib"] | ||
test = false | ||
bench = false | ||
|
||
[dependencies] | ||
simpleservo = { path = "../api" } | ||
log = "0.4" | ||
|
||
[features] | ||
default = ["unstable", "default-except-unstable"] | ||
default-except-unstable = ["webdriver", "max_log_level"] | ||
max_log_level = ["simpleservo/max_log_level"] | ||
webdriver = ["simpleservo/webdriver"] | ||
energy-profiling = ["simpleservo/energy-profiling"] | ||
debugmozjs = ["simpleservo/debugmozjs"] | ||
unstable = ["simpleservo/unstable"] | ||
googlevr = ["simpleservo/googlevr"] | ||
oculusvr = ["simpleservo/oculusvr"] | ||
native-bluetooth = ["simpleservo/native-bluetooth"] | ||
webgl_backtrace = ["simpleservo/webgl_backtrace"] | ||
js_backtrace = ["simpleservo/js_backtrace"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[package] | ||
name = "simpleservo_jniapi" | ||
version = "0.0.1" | ||
build = "build.rs" | ||
authors = ["The Servo Project Developers"] | ||
license = "MPL-2.0" | ||
edition = "2018" | ||
publish = false | ||
|
||
[lib] | ||
name = "simpleservo" | ||
crate-type = ["cdylib"] | ||
test = false | ||
bench = false | ||
|
||
[dependencies] | ||
android_injected_glue = "0.2" | ||
android_logger = "0.7" | ||
jni = "0.10.2" | ||
log = "0.4" | ||
simpleservo = { path = "../api" } | ||
libc = "0.2" | ||
|
||
[build-dependencies] | ||
cc = "1.0" | ||
|
||
[features] | ||
default = ["unstable", "default-except-unstable"] | ||
default-except-unstable = ["webdriver", "max_log_level"] | ||
max_log_level = ["simpleservo/max_log_level"] | ||
webdriver = ["simpleservo/webdriver"] | ||
energy-profiling = ["simpleservo/energy-profiling"] | ||
debugmozjs = ["simpleservo/debugmozjs"] | ||
unstable = ["simpleservo/unstable"] | ||
googlevr = ["simpleservo/googlevr"] | ||
oculusvr = ["simpleservo/oculusvr"] | ||
native-bluetooth = ["simpleservo/native-bluetooth"] | ||
webgl_backtrace = ["simpleservo/webgl_backtrace"] | ||
js_backtrace = ["simpleservo/js_backtrace"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.