aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-06-28 16:48:26 -0400
committerPaul Rouget <me@paulrouget.com>2019-07-03 21:35:44 +0200
commit7a3d346087dcc09112bf1bc13ec70de42ede509d (patch)
treef4d26d9306fffb57865650967eebf3a5ea4992b0 /python
parentf2e0870e60dfd4bf4233ac00c6bc46ab95f22067 (diff)
downloadservo-7a3d346087dcc09112bf1bc13ec70de42ede509d.tar.gz
servo-7a3d346087dcc09112bf1bc13ec70de42ede509d.zip
Simplify build process for UWP app.
Diffstat (limited to 'python')
-rw-r--r--python/servo/build_commands.py24
-rw-r--r--python/servo/command_base.py12
2 files changed, 32 insertions, 4 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 3937b73efd0..191ce44bb8a 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -30,7 +30,7 @@ from mach.decorators import (
from mach.registrar import Registrar
from mach_bootstrap import _get_exec_path
-from servo.command_base import CommandBase, cd, call, check_call, BIN_SUFFIX
+from servo.command_base import CommandBase, cd, call, check_call, BIN_SUFFIX, append_to_path_env
from servo.util import host_triple
@@ -169,7 +169,7 @@ class MachCommands(CommandBase):
@CommandBase.build_like_command_arguments
def build(self, release=False, dev=False, jobs=None, params=None,
no_package=False, verbose=False, very_verbose=False,
- target=None, android=False, magicleap=False, libsimpleservo=False,
+ target=None, android=False, magicleap=False, libsimpleservo=False, uwp=False,
features=None, **kwargs):
opts = params or []
features = features or []
@@ -240,6 +240,21 @@ class MachCommands(CommandBase):
env['CXXFLAGS'] = ''
env["CXXFLAGS"] += "-mmacosx-version-min=10.10"
+ if uwp:
+ # Don't try and build a desktop port.
+ libsimpleservo = True
+
+ # Ensure that the NuGet ANGLE package containing libEGL is accessible
+ # to the Rust linker.
+ append_to_path_env(
+ path.join(
+ os.getcwd(), "support", "hololens", "packages",
+ "ANGLE.WindowsStore.2.1.13", "bin", "UAP", "x64"
+ ),
+ env,
+ "LIB"
+ )
+
if android:
if "ANDROID_NDK" not in env:
print("Please set the ANDROID_NDK environment variable.")
@@ -532,7 +547,7 @@ class MachCommands(CommandBase):
status = self.run_cargo_build_like_command(
"build", opts, env=env, verbose=verbose,
- target=target, android=android, magicleap=magicleap, libsimpleservo=libsimpleservo,
+ target=target, android=android, magicleap=magicleap, libsimpleservo=libsimpleservo, uwp=uwp,
features=features, **kwargs
)
status = 0
@@ -585,7 +600,8 @@ class MachCommands(CommandBase):
for lib in libs:
print("WARNING: could not find " + lib)
- package_generated_shared_libraries(["libEGL.dll"], build_path, servo_exe_dir)
+ if not uwp:
+ package_generated_shared_libraries(["libEGL.dll"], build_path, servo_exe_dir)
# copy needed gstreamer DLLs in to servo.exe dir
target_triple = target or host_triple()
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 838e03f910c..265d2814eb6 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -782,6 +782,11 @@ install them, let us know by filing a bug!")
action='store_true',
help='Build with frame pointer enabled, used by the background hang monitor.',
),
+ CommandArgument(
+ '--uwp',
+ default=None,
+ action='store_true',
+ help='Build for HoloLens (x64)'),
CommandArgument('--with-raqote', default=None, action='store_true'),
CommandArgument('--without-wgl', default=None, action='store_true'),
]
@@ -809,6 +814,7 @@ install them, let us know by filing a bug!")
target=None, android=False, magicleap=False, libsimpleservo=False,
features=None, debug_mozjs=False, with_debug_assertions=False,
with_frame_pointer=False, with_raqote=False, without_wgl=False,
+ uwp=False,
):
env = env or self.build_env()
target, android = self.pick_target_triple(target, android, magicleap)
@@ -836,6 +842,12 @@ install them, let us know by filing a bug!")
features.append("debugmozjs")
if not magicleap:
features.append("native-bluetooth")
+ if uwp:
+ features.append("canvas2d-raqote")
+ features.append("no_wgl")
+ else:
+ # Non-UWP builds provide their own libEGL via mozangle.
+ features.append("egl")
if with_raqote and "canvas2d-azure" not in features:
features.append("canvas2d-raqote")
elif "canvas2d-raqote" not in features: