[libxml2] Allow build on Visual Studio 2017 community edition for WIN32 on a 64 bit machine.

commit 605899cf22d185f537eb5efb97a55be30467eb17
Author: Boris Shtrasman <borissh1983 gmail com>
Date:   Wed Aug 16 12:22:44 2017 +0300

    Allow build on Visual Studio 2017 community edition for WIN32 on a 64 bit machine.
    This patch hold the necessary changes to build libxml2 with Visual
    Studio 2017 for WIN32 on a 64 bit machine.
    Today 64 bit windows installation are very common, and Visual Studio
    2017 community is the most recent version i have access to.
    I have chosen 32 bit and SDK 8.1 to be as close as possible to Igor Zlatkovic work.

 win32/Makefile.msvc |   20 ++++++++++++++++----
 win32/Readme.txt    |   14 ++++++++++++++
 2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index d16c1a2..2e4d6f8 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -26,6 +26,18 @@ XML_IMP = $(XML_BASENAME).lib
 XML_A = $(XML_BASENAME)_a.lib
 XML_A_DLL = $(XML_BASENAME)_a_dll.lib
+VS14_INCLUDE = "C:\Program Files (x86)\Microsoft Visual 
+VS14_INCLUDE_AUX = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\include"
+VS14_INCLUDE_UCRT = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt"
+VS14_INCLUDE_UM = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um"
+VS14_INCLUDE_SHARED = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared"
+VS14_INCLUDE_WINRT = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\winrt\Include\um"
+WindowsSDK_IncludePath = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um"
+VC14_LINK_LIBRARY_PATH_X86 = "C:\Program Files (x86)\Microsoft Visual 
+VC14_LINK_LIBRARY_PATH_X86_AUX = "C:\Program Files (x86)\Microsoft Visual 
+VC14_LINK_LIBRARY_PATH_X86_UCRT = "C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86"
+VC14_LINK_LIBRARY_PATH_X86_WINSDK = "C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86"
 # Place where we let the compiler put its output.
 BINDIR = bin.msvc
@@ -36,14 +48,14 @@ UTILS_INTDIR = int.utils.msvc
 # The preprocessor and its options.
 CPP = cl.exe /EP
-CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL" 
+CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL"
 !if "$(WITH_THREADS)" != "no"
 # The compiler and its options.
 CC = cl.exe
-CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W1 $(CRUNTIME)
/I$(VS14_INCLUDE_WINRT) /I$(WindowsSDK_IncludePath)
 !if "$(WITH_THREADS)" != "no"
 # The linker and its options.
 LD = link.exe
 !if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1"
 LIBS = $(LIBS) wsock32.lib ws2_32.lib
diff --git a/win32/Readme.txt b/win32/Readme.txt
index 6b3eddd..8f45238 100644
--- a/win32/Readme.txt
+++ b/win32/Readme.txt
@@ -148,6 +148,20 @@ it will link to its own C-runtime named msvcr70.dll or msvcr71.dll. This
 file is not available on any machine which doesn't have Visual Studio 
 .NET installed.
+2.1.1 UCRT and 32bit
+If you use the compiler which comes with Visual Studio 2015 and above, note that
+it will link to its own C-runtime named msvcr140.dll or msvcr140.dll. That 
+files are redistributed via the ucrt packages (windows XP need the ucrt files manually copied).
+In order to build 32 bit on Visual Studio 2017 on a 64 bit machine,
+ you would need to call the 32 bit compiler:
+step1 update your path to call the 32bit versions (assuming Visual studio installed to C:\Program Files 
(x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017):
+set PATH="C:\Program Files (x86)\Microsoft Visual 
+step 2 call name
+nmake /f Makefile.msvc
 2.2 GNU C/C++, Mingw edition

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