Bug 1751331 - Use the mozbuild crate in mozglue-static. r=firefox-build-system-reviewers,mhentges

Differential Revision: https://phabricator.services.mozilla.com/D136559
This commit is contained in:
Mike Hommey 2022-01-25 21:29:50 +00:00
Родитель e013590cd1
Коммит b049d1d9cf
4 изменённых файлов: 12 добавлений и 19 удалений

12
Cargo.lock сгенерированный
Просмотреть файл

@ -3240,6 +3240,13 @@ dependencies = [
"moz_task",
]
[[package]]
name = "mozbuild"
version = "0.1.0"
dependencies = [
"once_cell",
]
[[package]]
name = "mozdevice"
version = "0.4.0"
@ -3260,6 +3267,7 @@ version = "0.1.0"
dependencies = [
"arrayvec 0.5.2",
"cc",
"mozbuild",
"rustc_version",
]
@ -6019,7 +6027,3 @@ dependencies = [
"podio",
"time",
]
[[patch.unused]]
name = "mozbuild"
version = "0.1.0"

Просмотреть файл

@ -282,7 +282,7 @@ def is_mozjs_cargo_member(line):
def is_mozjs_crates_io_local_patch(line):
"""Checks if the line in patch.crates-io is mozjs-related"""
return 'path = "js' in line
return any(f'path = "{p}' in line for p in ("js", "build", "third_party/rust"))
def clean():

Просмотреть файл

@ -11,6 +11,7 @@ path = "lib.rs"
arrayvec = "0.5"
[build-dependencies]
mozbuild = "0.1"
cc = "1"
rustc_version = "0.2"

Просмотреть файл

@ -3,25 +3,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use rustc_version::{version, Version};
use std::env;
use std::path::PathBuf;
fn main() {
let topobjdir = {
let path = PathBuf::from(env::var_os("MOZ_TOPOBJDIR").unwrap());
if !path.is_absolute() || !path.is_dir() {
panic!(
"MOZ_TOPOBJDIR must be an absolute directory, was: {}",
path.display()
);
}
path
};
let mut build = cc::Build::new();
build.cpp(true);
// For js-confdefs.h, see wrappers.cpp.
build.include(topobjdir.join("js").join("src"));
build.include(topobjdir.join("dist").join("include"));
build.include(mozbuild::TOPOBJDIR.join("js").join("src"));
build.include(mozbuild::TOPOBJDIR.join("dist").join("include"));
build.define("MOZ_HAS_MOZGLUE", None);
build.file("wrappers.cpp");
build.compile("wrappers");