0001-Fix-debug-crt-flags.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. diff --git a/nmake.opt b/nmake.opt
  2. index 468d2ba1a..e75a081f7 100644
  3. --- a/nmake.opt
  4. +++ b/nmake.opt
  5. @@ -148,16 +148,26 @@ GDAL_PDB = $(GDAL_ROOT)\gdal$(VERSION)$(POSTFIX).pdb
  6. !ENDIF
  7. !IFDEF WITH_PDB
  8. -CXX_PDB_FLAGS=/Zi /Fd$(GDAL_PDB)
  9. +CXX_PDB_FLAGS=/Z7 /Fd$(GDAL_PDB)
  10. !ELSE
  11. CXX_PDB_FLAGS=
  12. !ENDIF
  13. +# Flags to choose CRT variant to link against (e.g. static: /MT, /MTd, dynamic: /MD, /MDd)
  14. +# Ensure MRSID_CONFIG in mrsid/nmake.opt is set appropriately as well
  15. +!IFNDEF CXX_CRT_FLAGS
  16. +!IFNDEF DEBUG
  17. +CXX_CRT_FLAGS=/MD
  18. +!ELSE
  19. +CXX_CRT_FLAGS=/MDd
  20. +!ENDIF
  21. +!ENDIF
  22. +
  23. !IFNDEF OPTFLAGS
  24. !IF "$(DEBUG)" == "0"
  25. -OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP$(CPU_COUNT) /MD /EHsc /Ox /FC /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
  26. +OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP$(CPU_COUNT) $(CXX_CRT_FLAGS) /EHsc /Ox /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
  27. !ELSE
  28. -OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP$(CPU_COUNT) /MDd /EHsc /FC /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG
  29. +OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP$(CPU_COUNT) $(CXX_CRT_FLAGS) /EHsc /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG
  30. !ENDIF
  31. !ENDIF # OPTFLAGS
  32. @@ -175,7 +185,7 @@ OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP$(CPU_COUNT) /MDd /EH
  33. # 4351: new behavior: elements of array 'array' will be default initialized (needed for https://trac.osgeo.org/gdal/changeset/35593)
  34. # 4611: interaction between '_setjmp' and C++ object destruction is non-portable
  35. #
  36. -WARNFLAGS = /W4 /wd4127 /wd4251 /wd4275 /wd4786 /wd4100 /wd4245 /wd4206 /wd4351 /wd4611
  37. +WARNFLAGS = /W3 /wd4127 /wd4251 /wd4275 /wd4786 /wd4100 /wd4245 /wd4206 /wd4351 /wd4611
  38. !ENDIF