[librsvg] MSVC builds: Fix rsvg-internals.lib (Rust) linking



commit 0137cdf0dd934b76bca2be0680c19faf989f5204
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jan 17 11:25:12 2018 +0800

    MSVC builds: Fix rsvg-internals.lib (Rust) linking
    
    Later versions of Rust include the Rust architecture in the output
    directory by default (i.e i686-pc-windows-msvc or
    x86_64-pc-windows-msvc), so we must include that in the output path in
    both the NMake Makefile that is used to call cargo, as well as in the
    rsvg-rust project, so that the librsvg DLL can properly link, and to
    avoid running Cargo again when the Rust portion has been successfully
    built.

 win32/rsvg-rust.mak                 | 4 ++--
 win32/vs12/rsvg-build-defines.props | 5 +++++
 win32/vs12/rsvg-rust.vcxproj        | 8 ++++----
 3 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/win32/rsvg-rust.mak b/win32/rsvg-rust.mak
index fdde436..6561d15 100644
--- a/win32/rsvg-rust.mak
+++ b/win32/rsvg-rust.mak
@@ -32,9 +32,9 @@ CARGO_CMD = $(CARGO) build $(CARGO_TARGET) --release
 CARGO_CMD = $(CARGO) build $(CARGO_TARGET)
 !endif
 
-all: vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals\$(CFG)\rsvg_internals.lib
+all: vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\rsvg_internals.lib
 
-vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals\$(CFG)\rsvg_internals.lib:
+vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_internals\$(RUST_TARGET)-pc-windows-msvc\$(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)
diff --git a/win32/vs12/rsvg-build-defines.props b/win32/vs12/rsvg-build-defines.props
index 31416dd..a330d6a 100644
--- a/win32/vs12/rsvg-build-defines.props
+++ b/win32/vs12/rsvg-build-defines.props
@@ -12,6 +12,8 @@
     
<Gtk3IncPath>$(GlibEtcInstallRoot)\include\gtk-3.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(LibRsvgIncPath)</Gtk3IncPath>
     <Gtk3Libs>gtk-3.0.lib;gdk-3.0.lib</Gtk3Libs>
     
<RsvgPixbufLoaderCFlags>GDK_PIXBUF_ENABLE_BACKEND;G_LOG_DOMAIN="libpixbufloader-svg"</RsvgPixbufLoaderCFlags>
+    <RustTargetArch Condition="'$(Platform)' == 'x64'">x86_64</RustTargetArch>
+    <RustTargetArch Condition="'$(Platform)' == 'Win32'">i686</RustTargetArch>
     <RsvgRustNMakeCmd>
 cd ..
 set VCInstallDir=$(VCInstallDir)
@@ -61,5 +63,8 @@ nmake -f rsvg-rust.mak CFG=$(Configuration)</RsvgRustNMakeCmd>
     <BuildMacro Include="RsvgRustNMakeCmd">
       <Value>$(RsvgRustNMakeCmd)</Value>
     </BuildMacro>
+    <BuildMacro Include="RustTargetArch">
+      <Value>$(RustTargetArch)</Value>
+    </BuildMacro>
   </ItemGroup>
 </Project>
diff --git a/win32/vs12/rsvg-rust.vcxproj b/win32/vs12/rsvg-rust.vcxproj
index 2a04e77..4ee2891 100644
--- a/win32/vs12/rsvg-rust.vcxproj
+++ b/win32/vs12/rsvg-rust.vcxproj
@@ -71,25 +71,25 @@
     <NMakeBuildCommandLine>$(RsvgRustNMakeCmd)</NMakeBuildCommandLine>
     <NMakeReBuildCommandLine>$(RsvgRustNMakeCmd) clean all</NMakeReBuildCommandLine>
     <NMakeCleanCommandLine>$(RsvgRustNMakeCmd) clean</NMakeCleanCommandLine>
-    
<NMakeOutput>$(SolutionDir)\$(Configuration)\$(Platform)\obj\rsvg_internals\$(Configuration)\rsvg_internals.lib</NMakeOutput>
+    
<NMakeOutput>$(SolutionDir)\$(Configuration)\$(Platform)\obj\rsvg_internals\$(RustTargetArch)-pc-windows-msvc\$(Configuration)\rsvg_internals.lib</NMakeOutput>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <NMakeBuildCommandLine>$(RsvgRustNMakeCmd)</NMakeBuildCommandLine>
     <NMakeReBuildCommandLine>$(RsvgRustNMakeCmd) clean all</NMakeReBuildCommandLine>
     <NMakeCleanCommandLine>$(RsvgRustNMakeCmd) clean</NMakeCleanCommandLine>
-    
<NMakeOutput>$(SolutionDir)\$(Configuration)\$(Platform)\obj\rsvg_internals\$(Configuration)\rsvg_internals.lib</NMakeOutput>
+    
<NMakeOutput>$(SolutionDir)\$(Configuration)\$(Platform)\obj\rsvg_internals\$(RustTargetArch)-pc-windows-msvc\$(Configuration)\rsvg_internals.lib</NMakeOutput>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <NMakeBuildCommandLine>$(RsvgRustNMakeCmd)</NMakeBuildCommandLine>
     <NMakeReBuildCommandLine>$(RsvgRustNMakeCmd) clean all</NMakeReBuildCommandLine>
     <NMakeCleanCommandLine>$(RsvgRustNMakeCmd) clean</NMakeCleanCommandLine>
-    
<NMakeOutput>$(SolutionDir)\$(Configuration)\$(Platform)\obj\rsvg_internals\$(Configuration)\rsvg_internals.lib</NMakeOutput>
+    
<NMakeOutput>$(SolutionDir)\$(Configuration)\$(Platform)\obj\rsvg_internals\$(RustTargetArch)-pc-windows-msvc\$(Configuration)\rsvg_internals.lib</NMakeOutput>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <NMakeBuildCommandLine>$(RsvgRustNMakeCmd)</NMakeBuildCommandLine>
     <NMakeReBuildCommandLine>$(RsvgRustNMakeCmd) clean all</NMakeReBuildCommandLine>
     <NMakeCleanCommandLine>$(RsvgRustNMakeCmd) clean</NMakeCleanCommandLine>
-    
<NMakeOutput>$(SolutionDir)\$(Configuration)\$(Platform)\obj\rsvg_internals\$(Configuration)\rsvg_internals.lib</NMakeOutput>
+    
<NMakeOutput>$(SolutionDir)\$(Configuration)\$(Platform)\obj\rsvg_internals\$(RustTargetArch)-pc-windows-msvc\$(Configuration)\rsvg_internals.lib</NMakeOutput>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">


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