aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/servo/build_commands.py26
-rw-r--r--python/servo/command_base.py12
2 files changed, 27 insertions, 11 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index cade77fbbd7..a283b0d6c91 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -46,6 +46,8 @@ class MachCommands(CommandBase):
android = self.config["build"]["android"]
opts = []
+ features = []
+
if release:
opts += ["--release"]
if target:
@@ -54,8 +56,17 @@ class MachCommands(CommandBase):
opts += ["-j", jobs]
if verbose:
opts += ["-v"]
+ if android:
+ # Ensure the APK builder submodule has been built first
+ apk_builder_dir = "support/android-rs-glue"
+ with cd(path.join(apk_builder_dir, "apk-builder")):
+ subprocess.call(["cargo", "build"], env=self.build_env())
+
+ # FIXME: This can be simplified when glutin becomes the default
+ # and glfw has been removed.
+ opts += ["--target", "arm-linux-androideabi", "--no-default-features"]
+ features += ["glutin"]
- features = []
if debug_mozjs or self.config["build"]["debug-mozjs"]:
features += ["script/debugmozjs"]
@@ -72,16 +83,9 @@ class MachCommands(CommandBase):
env=self.build_env())
env['OPENSSL_PATH'] = path.join(self.android_support_dir(), "openssl-1.0.1j")
- make_opts = []
- if opts:
- make_opts += ["CARGO_OPTS=" + " ".join(opts)]
- status = subprocess.call(
- ["make", "-C", "ports/android"] + make_opts,
- env=env)
- else:
- status = subprocess.call(
- ["cargo", "build"] + opts,
- env=env, cwd=self.servo_crate())
+ status = subprocess.call(
+ ["cargo", "build"] + opts,
+ env=env, cwd=self.servo_crate())
elapsed = time() - build_start
print("Build completed in %0.2fs" % elapsed)
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 2af5fcd63c1..32c6b2538c9 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -140,6 +140,18 @@ class CommandBase(object):
if self.config["android"]["toolchain"]:
env["ANDROID_TOOLCHAIN"] = self.config["android"]["toolchain"]
+ # FIXME: These are set because they are the variable names that
+ # android-rs-glue expects. However, other submodules have makefiles that
+ # reference the env var names above. Once glutin is enabled and set as
+ # the default, we could modify the subproject makefiles to use the names
+ # below and remove the vars above, to avoid duplication.
+ if "ANDROID_SDK" in env:
+ env["ANDROID_HOME"] = env["ANDROID_SDK"]
+ if "ANDROID_NDK" in env:
+ env["NDK_HOME"] = env["ANDROID_NDK"]
+ if "ANDROID_TOOLCHAIN" in env:
+ env["NDK_STANDALONE"] = env["ANDROID_TOOLCHAIN"]
+
return env
def servo_crate(self):