vcpkg/ports/gdal/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch

51 lines
1.8 KiB
Diff
Raw Normal View History

From b25c3dc49ca1bcf9a789cf64c9fa8694e35127f0 Mon Sep 17 00:00:00 2001
From: Manuel Massing <m.massing@warped-space.de>
Date: Sun, 27 Nov 2016 09:57:04 +0100
Subject: [PATCH 2/2] Add variable CXX_CRT_FLAGS to allow for selection of C
runtime linkage in nmake build.
---
nmake.opt | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/nmake.opt b/nmake.opt
index 4d1c4fa..47c2df8 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -125,18 +125,28 @@ CXX_PDB_FLAGS=/Zi /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb
CXX_PDB_FLAGS=
!ENDIF
+# Flags to choose CRT variant to link against (e.g. static: /MT, /MTd, dynamic: /MD, /MDd)
+# Ensure MRSID_CONFIG in mrsid/nmake.opt is set appropriately as well
+!IFNDEF CXX_CRT_FLAGS
+!IFNDEF DEBUG
+CXX_CRT_FLAGS=/MD
+!ELSE
+CXX_CRT_FLAGS=/MDd
+!ENDIF
+!ENDIF
+
!IFNDEF OPTFLAGS
!IF $(MSVC_VER) >= 1400
!IFNDEF DEBUG
-OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MD /EHsc /Ox /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
+OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /Ox /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
!ELSE
-OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MD /EHsc /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG
+OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG
!ENDIF
!ELSE
!IFNDEF DEBUG
-OPTFLAGS= $(CXX_PDB_FLAGS) /nologo /MD /EHsc /GR /Ox /DNDEBUG
+OPTFLAGS= $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /GR /Ox /DNDEBUG
!ELSE
-OPTFLAGS= $(CXX_PDB_FLAGS) /nologo /MD /EHsc /GR /DDEBUG
+OPTFLAGS= $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /GR /DDEBUG
!ENDIF
!ENDIF #MSVC_VER
!ENDIF # OPTFLAGS
--
2.10.1.windows.1