Skip to content
Permalink
Browse files

Auto merge of #24185 - jdm:uwp-native-build, r=<try>

Fix many WACK errors

These changes ensure that all native dependencies are built with the compiler flags that will prevent forbidden API uses. They also incorporate a fork of rand_os that backports UWP support from more recent rand releases. This is necessary in the short term to avoid having to wait for the entire ecosystem to migrate to the most recent rand release.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because no windows WACK tests

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24185)
<!-- Reviewable:end -->
  • Loading branch information...
bors-servo committed Sep 11, 2019
2 parents 86ad841 + 1c738ed commit b297454e553884f80bf2702588d59ad6e98541ef
Showing with 36 additions and 23 deletions.
  1. +21 −21 Cargo.lock
  2. +7 −0 Cargo.toml
  3. +2 −1 components/script/Cargo.toml
  4. +1 −1 components/servo/Cargo.toml
  5. +5 −0 python/servo/build_commands.py

Some generated files are not rendered by default. Learn more.

@@ -28,3 +28,10 @@ opt-level = 3
# Those are here to dedupe winapi since mio is still using winapi 0.2.
mio = { git = "https://github.com/servo/mio.git", branch = "servo" }
iovec = { git = "https://github.com/servo/iovec.git", branch = "servo" }
rand_os = { git = "https://github.com/servo/rand", branch = "servo-rand_os-0.1.3-uwp" }
rand_core = { git = "https://github.com/servo/rand", branch = "servo-rand_os-0.1.3-uwp" }

[patch."https://github.com/servo/mozjs"]
mozjs_sys = { git = "https://github.com/jdm/mozjs", branch = "uwp-rustc-with-cpp-changes" }
[patch."https://github.com/servo/rust-mozjs"]
mozjs = { git = "https://github.com/jdm/rust-mozjs", branch = "uwp" }
@@ -20,14 +20,15 @@ webidl_lint = ["script_plugins/webidl_lint"]
default = ["unrooted_must_root_lint", "webidl_lint"]
webgl_backtrace = ["backtrace", "canvas_traits/webgl_backtrace"]
js_backtrace = ["backtrace"]
uwp = ["js/uwp"]

[build-dependencies]
cmake = "0.1"
phf_codegen = "0.7"
phf_shared = "0.7"
serde_json = "1.0"

[target.'cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))'.dependencies]
[target.'cfg(target_os = "linux")'.dependencies]
tinyfiledialogs = "3.0"

[dependencies]
@@ -25,7 +25,7 @@ layout-2020 = ["layout_thread_2020"]
max_log_level = ["log/release_max_level_info"]
native-bluetooth = ["bluetooth/native-bluetooth"]
no_wgl = ["canvas/no_wgl"]
uwp = ["servo_config/uwp"]
uwp = ["servo_config/uwp", "script/uwp"]
webrender_debugger = ["webrender/debugger"]
no_static_freetype = ["webrender/no_static_freetype"]
oculusvr = ["webvr/oculusvr"]
@@ -626,6 +626,11 @@ def build(self, release=False, dev=False, jobs=None, params=None,
if sys.platform == "win32":
env.setdefault("CC", "clang-cl.exe")
env.setdefault("CXX", "clang-cl.exe")
if uwp:
env.setdefault("CFLAGS", "")
env.setdefault("CXXFLAGS", "")
env["CFLAGS"] += " -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
env["CXXFLAGS"] += " -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
else:
env.setdefault("CC", "clang")
env.setdefault("CXX", "clang++")

0 comments on commit b297454

Please sign in to comment.
You can’t perform that action at this time.