Partial fix for #38489.

This commit is contained in:
Christoph Schulz 2016-12-22 14:35:11 +01:00
parent c217ab6c8d
commit a397add8a7
4 changed files with 26 additions and 4 deletions

View File

@ -9,11 +9,12 @@
// except according to those terms.
use super::{Target, TargetOptions};
use super::emscripten_base::{cmd};
pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
linker: "emcc".to_string(),
ar: "emar".to_string(),
linker: cmd("emcc"),
ar: cmd("emar"),
dynamic_linking: false,
executables: true,

View File

@ -0,0 +1,19 @@
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(not(windows))]
pub fn cmd(name: &str) -> String {
name.to_string()
}
#[cfg(windows)]
pub fn cmd(name: &str) -> String {
[name, ".bat"].concat()
}

View File

@ -58,6 +58,7 @@
mod arm_base;
mod bitrig_base;
mod dragonfly_base;
mod emscripten_base;
mod freebsd_base;
mod haiku_base;
mod linux_base;

View File

@ -9,11 +9,12 @@
// except according to those terms.
use super::{Target, TargetOptions};
use super::emscripten_base::{cmd};
pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
linker: "emcc".to_string(),
ar: "emar".to_string(),
linker: cmd("emcc"),
ar: cmd("emar"),
dynamic_linking: false,
executables: true,