[librsvg/rustification] Visual Studio builds: Add NMake Makefile for the Rust bits



commit 6583d84ef2989d009ddb646eceea43ea53675dd9
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Dec 15 22:10:19 2016 +0800

    Visual Studio builds: Add NMake Makefile for the Rust bits
    
    We need to call cargo to build the rust portions of librsvg, before we can
    link the final librsvg DLL, so add an NMake Makefile that can be used to
    build and clean the parts, with the needed envvars set.
    
    This will indicate that we will no longer support Visual Studio 2012 (or
    earlier) builds, as Rust will generate code that will need items in the
    Visual Studio 2013 (and later) CRTs during linking.
    
    More commits to follow in this regard, but this paves the first step to
    support Visual Studio builds for the rust-ified librsvg.

 build/win32/Makefile.am   |    1 +
 build/win32/rsvg-rust.mak |   46 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am
index 37b1e23..a839e54 100644
--- a/build/win32/Makefile.am
+++ b/build/win32/Makefile.am
@@ -32,4 +32,5 @@ EXTRA_DIST = \
        rsvg-introspection-msvc.mak     \
        introspection-msvc.mak  \
        detectenv-msvc.mak      \
+       rsvg-rust.mak           \
        $(GENERATED_ITEMS)
diff --git a/build/win32/rsvg-rust.mak b/build/win32/rsvg-rust.mak
new file mode 100644
index 0000000..36af547
--- /dev/null
+++ b/build/win32/rsvg-rust.mak
@@ -0,0 +1,46 @@
+!include detectenv-msvc.mak
+
+!if "$(CARGO)" == ""
+BUILD_RUST = 0
+!else
+BUILD_RUST = 1
+!endif
+
+!if "$(VALID_CFGSET)" == "TRUE"
+BUILD_RUST = 1
+!else
+BUILD_RUST = 0
+!endif
+
+!if "$(BUILD_RUST)" == "1"
+!if "$(CFG)" == "release" || "$(CFG)" == "Release"
+CARGO_CMD = $(CARGO) build --release
+!else
+CARGO_CMD = $(CARGO) build
+!endif
+
+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=..\build\win32\vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals
+       @set GTK_LIB_DIR=..\..\vs$(VSVER)\$(PLAT)\lib;$(LIB)
+       @cd ..\..\rust
+       $(CARGO_CMD) --verbose
+       @cd ..\build\win32\vs$(VSVER)
+       @set GTK_LIB_DIR=
+       @set CARGO_TARGET_DIR=
+
+clean:
+       @set CARGO_TARGET_DIR=..\build\win32\vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals
+       @cd ..\..\rust
+       @$(CARGO) clean
+       @cd ..\build\win32\vs$(VSVER)
+       @set CARGO_TARGET_DIR=
+       
+!else
+!if "$(VALID_CFGSET)" == "FALSE"
+!error You need to specify an appropriate config for your build, using CFG=Release|Debug
+!else
+!error You need to specify an appropriate path for your cargo executable using CARGO=<path_to_cargo.exe>
+!endif
+!endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]