author Emilio Cobos Álvarez <emilio@crisal.io>
Fri, 01 Jun 2018 18:30:30 +0200
changeset 420970 bb85c5ee5afc151be0d07ecc48318dc69cfef446
parent 419792 bbe538384ae8b61c0af775305facc392f172fd94
child 438678 e58d578f13d990ac2064d38692b2440bc96f9e2f
permissions -rw-r--r--
Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj Same approach as the other bug, mostly replacing automatically by removing 'using mozilla::Forward;' and then: s/mozilla::Forward/std::forward/ s/Forward</std::forward</ The only file that required manual fixup was TestTreeTraversal.cpp, which had a class called TestNodeForward with template parameters :) MozReview-Commit-ID: A88qFG5AccP

// 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
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

extern crate num_cpus;

use std::env;
use std::process::{Command, Stdio};

fn main() {
    let out_dir = env::var("OUT_DIR").expect("Should have env var OUT_DIR");
    let target = env::var("TARGET").expect("Should have env var TARGET");

    let js_src = env::var("CARGO_MANIFEST_DIR").expect("Should have env var CARGO_MANIFEST_DIR");

    env::set_var("MAKEFLAGS", format!("-j{}", num_cpus::get()));

    let variant = format!("{}{}",
                          if cfg!(feature = "bigint") { "bigint" } else { "plain" },
                          if cfg!(feature = "debugmozjs") { "debug" } else { "" });

    let python = env::var("PYTHON").unwrap_or("python2.7".into());
    let mut cmd = Command::new(&python);
               // Only build SpiderMonkey, don't run all the tests.
               // Disable Mozilla's jemalloc; Rust has its own jemalloc that we
               // can swap in instead and everything using a single malloc is
               // good.
               // Don't try to clobber the output directory. Without
               // this option, the build will fail because the directory
               // already exists but wasn't created by autospider.
               "--objdir", &out_dir,
        .env("SOURCE", &js_src)
        .env("PWD", &js_src)
    println!("Running command: {:?}", cmd);
    let result = cmd
        .expect("Should spawn autospider OK");
    assert!(result.success(), "autospider should exit OK");

    println!("cargo:rustc-link-search=native={}/js/src/build", out_dir);
    println!("cargo:rustc-link-search=native={}/js/src", out_dir);

    println!("cargo:rustc-link-search=native={}/dist/bin", out_dir);

    if cfg!(feature = "bigint") {

    if target.contains("windows") {
        if target.contains("gnu") {
    } else {

    println!("cargo:outdir={}", out_dir);