diff --git a/.appveyor.yml b/.appveyor.yml index 26ae0691..3de89da7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,8 @@ build: false install: # Install rust - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - - rustup-init -yv --default-toolchain stable + - IF "%PLATFORM%" == "x86" rustup-init -y --default-toolchain stable --default-host i686-pc-windows-msvc + - IF "%PLATFORM%" == "x64" rustup-init -y --default-toolchain stable --default-host x86_64-pc-windows-msvc - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - rustc -vV - cargo -vV diff --git a/cli/src/loader.rs b/cli/src/loader.rs index afb18f9e..7aa0ca50 100644 --- a/cli/src/loader.rs +++ b/cli/src/loader.rs @@ -15,6 +15,8 @@ const DYLIB_EXTENSION: &'static str = "so"; #[cfg(windows)] const DYLIB_EXTENSION: &'static str = "dll"; +const BUILD_TARGET: &'static str = env!("BUILD_TARGET"); + struct LanguageRepo { name: String, path: PathBuf, @@ -156,8 +158,8 @@ impl Loader { .cpp(true) .opt_level(2) .cargo_metadata(false) - .target(env!("BUILD_TARGET")) - .host(env!("BUILD_TARGET")); + .target(BUILD_TARGET) + .host(BUILD_TARGET); let compiler = config.get_compiler(); let mut command = Command::new(compiler.path()); for (key, value) in compiler.env() { @@ -165,6 +167,9 @@ impl Loader { } if cfg!(windows) { + if !BUILD_TARGET.contains("64") { + command.env("Platform", "x86"); + } command .args(&["/nologo", "/LD", "/I"]) .arg(header_path)