vcpkg/ports/gdal/0001-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch
Mateusz Loskot 6df1629d4d [gdal] Update port to latest GDAL 2.2.2
* Bump GDAL version wherever necessary
* Update download package and checksum.
* Remove 0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch
  no longer necessary.
* Recalculate 000N prefix in patche filenames after the removal.
* Update 0002-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch
  * Patch pushed upstream https://trac.osgeo.org/gdal/ticket/7055
    and should no longer be necessary in GDAL 2.2.3 or later
* Update 0003-Fix-openjpeg-include.patch
2017-09-26 19:13:28 +02:00

38 lines
1.4 KiB
Diff

diff --git a/nmake.opt b/nmake.opt
index bd5719c2d1..f6101ccd59 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -127,18 +127,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 /MP /MD /EHsc /Ox /FC /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 /MP /MD /EHsc /FC /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 /FC /DNDEBUG
+OPTFLAGS= $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /GR /Ox /DNDEBUG
!ELSE
-OPTFLAGS= $(CXX_PDB_FLAGS) /nologo /MD /EHsc /GR /FC /DDEBUG
+OPTFLAGS= $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /GR /DDEBUG
!ENDIF
!ENDIF #MSVC_VER
!ENDIF # OPTFLAGS