Skip to content

Commit

Permalink
Auto merge of #21 - jdm:sse2, r=<try>
Browse files Browse the repository at this point in the history
Improve libEGL build for Windows arm64

This disables the use of SSE2 in libEGL on non-Intel targets, and also generates a static libEGL.lib.
  • Loading branch information
bors-servo authored Jun 7, 2019
2 parents 5d9bf86 + 3e5d999 commit 40ea9cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mozangle"
version = "0.2.1"
version = "0.2.2"
authors = ["The ANGLE Project Authors", "The Servo Project Developers"]
license = " BSD-3-Clause"
description = "Mozilla’s fork of Google ANGLE, repackaged as a Rust crate "
Expand Down
18 changes: 14 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ fn build_egl(target: &str) {
build.include(fixup_path(file));
}

for file in data.sources {
build.file(fixup_path(file));
}

if target.contains("x86_64") || target.contains("i686") {
build
.flag_if_supported("-msse2") // GNU
.flag_if_supported("-arch:SSE2"); // MSVC
}

// Build DLL.
let mut cmd = build.get_compiler().to_command();
let out = env::var("OUT_DIR").unwrap();
let out = Path::new(&out);
Expand All @@ -36,10 +47,6 @@ fn build_egl(target: &str) {
cmd.arg(&format!("{}.lib", lib));
}

for file in data.sources {
cmd.arg(fixup_path(file));
}

cmd.arg("/wd4100");
cmd.arg("/wd4127");
cmd.arg("/LD");
Expand All @@ -48,6 +55,9 @@ fn build_egl(target: &str) {
cmd.arg("/DEF:gfx/angle/checkout/src/libEGL/libEGL.def");
let status = cmd.status();
assert!(status.unwrap().success());

// Build lib.
build.compile("EGL");
}

fn build_angle() {
Expand Down

0 comments on commit 40ea9cd

Please sign in to comment.