Commit facef142 authored by Chun-wei Fan's avatar Chun-wei Fan

win32/rsvg-rust.mak: Streamline Rust build process

As the recommended way to setup Rust is via rustup, set the default
toolchain/target during the NMake build process, so that one will only
need to have the Rust executables in their PATH and ensure that they
have the needed toolchains (i686-pc-windows-msvc and/or
x86_64-pc-windows-msvc) installed via rustup.

Please note that we are being conservative here-we use the stable
releases of the toolchains only.  If using a beta/nightly toolchain
release, one needs to update this file for this purpose.
parent fd1be778
......@@ -4,6 +4,16 @@
CARGO = cargo
!endif
!if "$(RUSTUP)" == ""
RUSTUP = rustup
!endif
!if "$(PLAT)" == "x64"
RUST_TARGET = x86_64
!else
RUST_TARGET = i686
!endif
!if "$(VALID_CFGSET)" == "TRUE"
BUILD_RUST = 1
!else
......@@ -11,10 +21,15 @@ BUILD_RUST = 0
!endif
!if "$(BUILD_RUST)" == "1"
CARGO_TARGET = --target $(RUST_TARGET)-pc-windows-msvc
DEFAULT_TARGET = stable-$(RUST_TARGET)-pc-windows-msvc
RUSTUP_CMD = $(RUSTUP) default $(DEFAULT_TARGET)
!if "$(CFG)" == "release" || "$(CFG)" == "Release"
CARGO_CMD = $(CARGO) build --release
CARGO_CMD = $(CARGO) build $(CARGO_TARGET) --release
!else
CARGO_CMD = $(CARGO) build
CARGO_CMD = $(CARGO) build $(CARGO_TARGET)
!endif
all: vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals\$(CFG)\rsvg_internals.lib
......@@ -22,6 +37,7 @@ all: vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals\$(CFG)\rsvg_internals.lib
vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals\$(CFG)\rsvg_internals.lib:
@set CARGO_TARGET_DIR=..\win32\vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals
@set GTK_LIB_DIR=..\..\vs$(VSVER)\$(PLAT)\lib;$(LIB)
$(RUSTUP_CMD)
@cd ..\rust
$(CARGO_CMD) --verbose
@cd ..\win32\vs$(VSVER)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment