Use different output folder for every triplet, and add debug info to release builds

This commit is contained in:
Martin Müller 2016-11-22 09:44:37 +01:00
parent adc2a901b1
commit 7ebd074e06
6 changed files with 155 additions and 77 deletions

View File

@ -1,27 +0,0 @@
diff --git "a/win32/Makefile.msvc" "b/win32/Makefile.msvc"
index d16c1a2..09d2291 100644
--- "a/win32/Makefile.msvc"
+++ "b/win32/Makefile.msvc"
@@ -72,7 +72,7 @@ LIBS =
LIBS = $(LIBS) wsock32.lib ws2_32.lib
!endif
!if "$(WITH_ICONV)" == "1"
-LIBS = $(LIBS) iconv.lib
+LIBS = $(LIBS) libiconv.lib libcharset.lib
!endif
!if "$(WITH_ICU)" == "1"
LIBS = $(LIBS) icu.lib
@@ -80,7 +80,11 @@ LIBS = $(LIBS) icu.lib
!if "$(WITH_ZLIB)" == "1"
# could be named differently zdll or zlib
# LIBS = $(LIBS) zdll.lib
-LIBS = $(LIBS) zlib.lib
+!if "$(DEBUG)" == "1"
+LIBS = $(LIBS) zlibd.lib
+!else
+LIBS = $(LIBS) zlib.lib
+!endif
!endif
!if "$(WITH_LZMA)" == "1"
LIBS = $(LIBS) liblzma.lib

View File

@ -0,0 +1,60 @@
---
win32/Makefile.msvc | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index d16c1a2..de9e22e 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -28,11 +28,11 @@ XML_A = $(XML_BASENAME)_a.lib
XML_A_DLL = $(XML_BASENAME)_a_dll.lib
# Place where we let the compiler put its output.
-BINDIR = bin.msvc
-XML_INTDIR = int.msvc
-XML_INTDIR_A = int.a.msvc
-XML_INTDIR_A_DLL = int.a.dll.msvc
-UTILS_INTDIR = int.utils.msvc
+BINDIR = $(OUTDIR)\bin.msvc
+XML_INTDIR = $(OUTDIR)\int.msvc
+XML_INTDIR_A = $(OUTDIR)\int.a.msvc
+XML_INTDIR_A_DLL = $(OUTDIR)\int.a.dll.msvc
+UTILS_INTDIR = $(OUTDIR)\int.utils.msvc
# The preprocessor and its options.
CPP = cl.exe /EP
@@ -72,16 +72,18 @@ LIBS =
LIBS = $(LIBS) wsock32.lib ws2_32.lib
!endif
!if "$(WITH_ICONV)" == "1"
-LIBS = $(LIBS) iconv.lib
+LIBS = $(LIBS) libiconv.lib libcharset.lib
!endif
!if "$(WITH_ICU)" == "1"
LIBS = $(LIBS) icu.lib
!endif
!if "$(WITH_ZLIB)" == "1"
-# could be named differently zdll or zlib
-# LIBS = $(LIBS) zdll.lib
+!if "$(DEBUG)" == "1"
+LIBS = $(LIBS) zlibd.lib
+!else
LIBS = $(LIBS) zlib.lib
!endif
+!endif
!if "$(WITH_LZMA)" == "1"
LIBS = $(LIBS) liblzma.lib
!endif
@@ -101,10 +103,10 @@ ARFLAGS = /nologo
CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
LDFLAGS = $(LDFLAGS) /DEBUG
!else
CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
# commented out as this break VC10 c.f. 634846
# LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
-LDFLAGS = $(LDFLAGS)
+LDFLAGS = $(LDFLAGS) /DEBUG /OPT:REF /OPT:ICF
!endif
# Libxml object files.
--

View File

@ -19,7 +19,7 @@ find_program(NMAKE nmake)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}/
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile-imports.patch
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile.patch
)
set(SCRIPTS_DIR ${SOURCE_PATH}/win32)
@ -61,11 +61,14 @@ vcpkg_execute_required_process(
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME config-${TARGET_TRIPLET}-rel
)
# Handle build output directory
file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" OUTDIR)
file(MAKE_DIRECTORY "${OUTDIR}")
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
message(STATUS "Building ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${NMAKE} /f Makefile.msvc rebuild
COMMAND ${NMAKE} /f Makefile.msvc rebuild OUTDIR=${OUTDIR}
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME build-${TARGET_TRIPLET}-rel
)
@ -73,7 +76,7 @@ message(STATUS "Building ${TARGET_TRIPLET}-rel done")
message(STATUS "Installing ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${NMAKE} /f Makefile.msvc install
COMMAND ${NMAKE} /f Makefile.msvc install OUTDIR=${OUTDIR}
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME install-${TARGET_TRIPLET}-rel
)
@ -103,11 +106,14 @@ vcpkg_execute_required_process(
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME config-${TARGET_TRIPLET}-dbg
)
# Handle build output directory
file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" OUTDIR)
file(MAKE_DIRECTORY "${OUTDIR}")
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND ${NMAKE} /f Makefile.msvc rebuild
COMMAND ${NMAKE} /f Makefile.msvc rebuild OUTDIR=${OUTDIR}
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME build-${TARGET_TRIPLET}-dbg
)
@ -115,7 +121,7 @@ message(STATUS "Building ${TARGET_TRIPLET}-dbg done")
message(STATUS "Installing ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND ${NMAKE} /f Makefile.msvc install
COMMAND ${NMAKE} /f Makefile.msvc install OUTDIR=${OUTDIR}
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME install-${TARGET_TRIPLET}-dbg
)

View File

@ -1,40 +0,0 @@
---
win32/Makefile.msvc | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index 23a02d2..b02af8e 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -59,7 +59,14 @@ CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
LD = link.exe
LDFLAGS = /nologo
LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
-LIBS = wsock32.lib
+# The libraries are needed for static builds (the makefile builds all tools and dlls)
+LIBS = wsock32.lib libiconv.lib libcharset.lib
+!if "$(DEBUG)" == "1"
+LIBS = $(LIBS) zlibd.lib
+!else
+LIBS = $(LIBS) zlib.lib
+!endif
+
# The archiver and its options.
AR = lib.exe
@@ -309,13 +316,7 @@ $(UTILS_INTDIR) :
# An implicit rule for xsltproc and friends.
APPLIBS = $(LIBS)
!if "$(STATIC)" == "1"
-APPLIBS = $(LIBS) libxml2_a.lib
-!if "$(WITH_ICONV)" == "1"
-APPLIBS = $(APPLIBS) iconv.lib
-!endif
-!if "$(WITH_ZLIB)" == "1"
-APPLIBS = $(APPLIBS) zlib.lib
-!endif
+APPLIBS = $(LIBS) libxml2.lib
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) /D "LIBXML_STATIC" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" \
$(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
--

View File

@ -0,0 +1,73 @@
---
win32/Makefile.msvc | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index 23a02d2..b13dd26 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -22,7 +22,7 @@ BASEDIR = ..
XSLT_SRCDIR = $(BASEDIR)\libxslt
EXSLT_SRCDIR = $(BASEDIR)\libexslt
UTILS_SRCDIR = $(BASEDIR)\xsltproc
-BINDIR = bin.msvc
+BINDIR = $(OUTDIR)\bin.msvc
# Names of various input and output components.
XSLT_NAME = xslt
@@ -39,11 +39,11 @@ EXSLT_DEF = $(EXSLT_BASENAME).def
EXSLT_A = $(EXSLT_BASENAME)_a.lib
# Places where intermediate files produced by the compiler go
-XSLT_INTDIR = int.xslt.msvc
-XSLT_INTDIR_A = int.xslta.msvc
-EXSLT_INTDIR = int.exslt.msvc
-EXSLT_INTDIR_A = int.exslta.msvc
-UTILS_INTDIR = int.utils.msvc
+XSLT_INTDIR = $(OUTDIR)\int.xslt.msvc
+XSLT_INTDIR_A = $(OUTDIR)\int.xslta.msvc
+EXSLT_INTDIR = $(OUTDIR)\int.exslt.msvc
+EXSLT_INTDIR_A = $(OUTDIR)\int.exslta.msvc
+UTILS_INTDIR = $(OUTDIR)\int.utils.msvc
# The preprocessor and its options.
CPP = cl.exe /EP
@@ -59,7 +59,13 @@ CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
LD = link.exe
LDFLAGS = /nologo
LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
-LIBS = wsock32.lib
+# The libraries are needed for static builds (the makefile builds all tools and dlls)
+LIBS = wsock32.lib libiconv.lib libcharset.lib
+!if "$(DEBUG)" == "1"
+LIBS = $(LIBS) zlibd.lib
+!else
+LIBS = $(LIBS) zlib.lib
+!endif
# The archiver and its options.
AR = lib.exe
@@ -71,6 +77,7 @@ CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
LDFLAGS = $(LDFLAGS) /DEBUG
!else
CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
+LDFLAGS = $(LDFLAGS) /DEBUG /OPT:REF /OPT:ICF
!endif
# Libxslt object files.
@@ -309,13 +316,7 @@ $(UTILS_INTDIR) :
# An implicit rule for xsltproc and friends.
APPLIBS = $(LIBS)
!if "$(STATIC)" == "1"
-APPLIBS = $(LIBS) libxml2_a.lib
-!if "$(WITH_ICONV)" == "1"
-APPLIBS = $(APPLIBS) iconv.lib
-!endif
-!if "$(WITH_ZLIB)" == "1"
-APPLIBS = $(APPLIBS) zlib.lib
-!endif
+APPLIBS = $(LIBS) libxml2.lib
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) /D "LIBXML_STATIC" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" \
$(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
--

View File

@ -19,7 +19,7 @@ find_program(NMAKE nmake)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}/
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile-imports.patch
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile.patch
)
set(SCRIPTS_DIR ${SOURCE_PATH}/win32)
@ -62,11 +62,14 @@ vcpkg_execute_required_process(
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME config-${TARGET_TRIPLET}-rel
)
# Handle build output directory
file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" OUTDIR)
file(MAKE_DIRECTORY "${OUTDIR}")
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
message(STATUS "Building ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${NMAKE} /f Makefile.msvc rebuild
COMMAND ${NMAKE} /f Makefile.msvc rebuild OUTDIR=${OUTDIR}
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME build-${TARGET_TRIPLET}-rel
)
@ -74,7 +77,7 @@ message(STATUS "Building ${TARGET_TRIPLET}-rel done")
message(STATUS "Installing ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${NMAKE} /f Makefile.msvc install
COMMAND ${NMAKE} /f Makefile.msvc install OUTDIR=${OUTDIR}
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME install-${TARGET_TRIPLET}-rel
)
@ -104,11 +107,14 @@ vcpkg_execute_required_process(
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME config-${TARGET_TRIPLET}-dbg
)
# Handle build output directory
file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" OUTDIR)
file(MAKE_DIRECTORY "${OUTDIR}")
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND ${NMAKE} /f Makefile.msvc rebuild
COMMAND ${NMAKE} /f Makefile.msvc rebuild OUTDIR=${OUTDIR}
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME build-${TARGET_TRIPLET}-dbg
)
@ -116,7 +122,7 @@ message(STATUS "Building ${TARGET_TRIPLET}-dbg done")
message(STATUS "Installing ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND ${NMAKE} /f Makefile.msvc install
COMMAND ${NMAKE} /f Makefile.msvc install OUTDIR=${OUTDIR}
WORKING_DIRECTORY ${SCRIPTS_DIR}
LOGNAME install-${TARGET_TRIPLET}-dbg
)