Source code
Revision control
Copy as Markdown
Other Tools
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# This crate builds a staticlib. `../fenix-dylib` creates the final cdylib from it.
UNIFIED_SOURCES += [
"stub.cpp",
]
megazord_rust_features = ["mozbuild-rustlib"]
# This is the name of the .a file created.
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android" or CONFIG["MOZ_LIBMEGAZORD_ARTIFACTS"]:
RustLibrary("megazord", features=megazord_rust_features)
else:
RustLibrary(
"megazord",
features=megazord_rust_features,
output_category="uniffi-target",
)
# Qualified to nss so it applies to every -p test's transitive nss dep;
# emits NSS dylib refs plus static mozpkix linkage for the test binaries.
RUST_TEST_FEATURES = ["nss-as/mozbuild-rustlib"]
RUST_TESTS = [
"logins",
"megazord",
"rc_crypto",
]
# On Android, libmegazord.so must use bionic's allocator rather than mozglue's
# mozjemalloc. Depending on nss still builds mozglue before Cargo runs.
if CONFIG["OS_TARGET"] != "Android":
USE_LIBS += ["mozglue"]
USE_LIBS += ["nss"]
if CONFIG["OS_TARGET"] == "Linux":
USE_LIBS += [
"freeblpriv3",
]
# NSS loads libraries dynamically.
USE_LIBS += [
# Without `freebl3`, expect: "Could not initialize NSS: NSS error: -8023".
"freebl3",
# Without `softokn3`, expect: "Could not initialize NSS: NSS error: -5925".
"softokn3",
]
# `mozpkix` and its requirement `pure_virtual` are static libraries.
USE_LIBS += [
"mozpkix",
"pure_virtual",
]