File tree 6 files changed +16
-26
lines changed
6 files changed +16
-26
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ before_install:
17
17
18
18
script :
19
19
- cargo test --verbose
20
+ - cargo test --verbose --features egl # Doesn’t do anything, but should still build
20
21
21
22
notifications :
22
23
webhooks : http://build.servo.org:54856/travis
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " mozangle"
3
- version = " 0.1.3 "
3
+ version = " 0.1.4 "
4
4
authors = [" The ANGLE Project Authors" , " The Servo Project Developers" ]
5
5
license = " BSD-3-Clause"
6
6
description = " Mozilla’s fork of Google ANGLE, repackaged as a Rust crate "
@@ -15,4 +15,4 @@ cc = { version = "1.0.5", features = ["parallel"] }
15
15
gl_generator = { version = " 0.9.0" , optional = true }
16
16
17
17
[features ]
18
- egl = [" gl_generator" ] # Only supported on Windows
18
+ egl = [" gl_generator" ] # Only does anything on Windows
Original file line number Diff line number Diff line change @@ -30,18 +30,13 @@ Feature flags
30
30
-------------
31
31
32
32
By default, this crate only compiles the shader translator.
33
- This should be cross-platform, and can be used with:
34
33
35
- ``` toml
36
- [dependencies ]
37
- mozangle = " 0.1"
38
- ```
39
-
40
- The ` egl ` Cargo feature enables the EGL and OpenGL ES implementations.
41
- This is only supported on Windows, since the Direct3D 11 rendering backend is configured.
34
+ In Windows, the ` egl ` Cargo feature enables the EGL and OpenGL ES implementations.
35
+ Although upstream ANGLE supports more platforms,
36
+ this crate only configures the Direct3D 11 rendering backend.
42
37
43
38
``` toml
44
- [target . 'cfg(windows)' . dependencies ]
39
+ [dependencies ]
45
40
mozangle = { version = " 0.1" , features = [" egl" ] }
46
41
```
47
42
Original file line number Diff line number Diff line change @@ -12,19 +12,8 @@ fn main() {
12
12
}
13
13
14
14
fn build_angle ( ) {
15
- let egl = env:: var ( "CARGO_FEATURE_EGL" ) . is_ok ( ) ;
16
15
let target = env:: var ( "TARGET" ) . unwrap ( ) ;
17
- if egl && !target. contains ( "windows" ) {
18
- println ! ( "" ) ;
19
- println ! ( "The `egl` feature is only supported on Windows." ) ;
20
- println ! ( "" ) ;
21
- println ! ( "Consider specifying your dependency like this:" ) ;
22
- println ! ( "" ) ;
23
- println ! ( "[target.'cfg(windows)'.dependencies]" ) ;
24
- println ! ( "mozangle = {{ version = \" 0.1\" , features = [\" egl\" ] }}" ) ;
25
- println ! ( "" ) ;
26
- std:: process:: exit ( 1 )
27
- }
16
+ let egl = env:: var ( "CARGO_FEATURE_EGL" ) . is_ok ( ) && target. contains ( "windows" ) ;
28
17
29
18
let data = if egl { build_data:: EGL } else { build_data:: TRANSLATOR } ;
30
19
@@ -88,6 +77,11 @@ fn generate_bindings() {
88
77
use gl_generator:: { Registry , Api , Profile , Fallbacks } ;
89
78
use std:: fs:: File ;
90
79
80
+ let target = env:: var ( "TARGET" ) . unwrap ( ) ;
81
+ if !target. contains ( "windows" ) {
82
+ return
83
+ }
84
+
91
85
let out_dir = PathBuf :: from ( env:: var_os ( "OUT_DIR" ) . unwrap ( ) ) ;
92
86
93
87
let mut file = File :: create ( & out_dir. join ( "egl_bindings.rs" ) ) . unwrap ( ) ;
Original file line number Diff line number Diff line change 3
3
pub mod shaders;
4
4
#[ cfg( test) ] mod tests;
5
5
6
- #[ cfg( feature = "egl" ) ]
6
+ #[ cfg( all ( windows , feature = "egl" ) ) ]
7
7
pub mod gles {
8
8
pub mod ffi {
9
9
include ! ( concat!( env!( "OUT_DIR" ) , "/gles_bindings.rs" ) ) ;
10
10
}
11
11
}
12
12
13
- #[ cfg( feature = "egl" ) ]
13
+ #[ cfg( all ( windows , feature = "egl" ) ) ]
14
14
pub mod egl {
15
15
use std:: ffi:: CString ;
16
16
use std:: os:: raw:: c_void;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ fn test_linkage() {
13
13
init ( ) ;
14
14
}
15
15
16
- #[ cfg( feature = "egl" ) ]
16
+ #[ cfg( all ( windows , feature = "egl" ) ) ]
17
17
#[ test]
18
18
fn test_egl_linkage ( ) {
19
19
use egl:: ffi;
You can’t perform that action at this time.
0 commit comments