From e3001c78b91531b5170181935fd7b0293fdb82a8 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Wed, 30 Nov 2016 10:26:18 +0100 Subject: [PATCH] [gdal] Enable building of PDBs in release builds as well, copy PDBs over --- ...n-of-PDB-in-release-dll-if-so-reques.patch | 26 +++++++++++++++++++ ports/gdal/portfile.cmake | 14 +++++++--- 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 ports/gdal/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch diff --git a/ports/gdal/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch b/ports/gdal/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch new file mode 100644 index 0000000000..1065a29827 --- /dev/null +++ b/ports/gdal/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch @@ -0,0 +1,26 @@ +From 9da0cb6eed442ebf3eea232cd85e26c155c963ef Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Tue, 29 Nov 2016 12:43:58 +0100 +Subject: [PATCH 3/4] - Ensures inclusion of PDB in release dll if so requested + +--- + gdal/nmake.opt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/nmake.opt b/nmake.opt +index 47c2df8..4844d22 100644 +--- a/nmake.opt ++++ b/nmake.opt +@@ -174,6 +174,9 @@ SOFTWARNFLAGS= /wd4244 /wd4702 /wd4701 /wd4013 /wd4706 /wd4057 /wd4210 /wd4305 + # Linker debug options + !IFDEF DEBUG + LDEBUG= /debug ++!ELSEIFDEF WITH_PDB ++# Ensures that PDB is included in release DLL if so requested ++LDEBUG= /debug /opt:ref /opt:icf + !ENDIF + + # Uncomment the following if you are building for 64-bit windows +-- +2.10.1.windows.1 + diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index 698c96a5c2..ee003d622c 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -22,7 +22,8 @@ foreach(BUILD_TYPE debug release) PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch ${CMAKE_CURRENT_LIST_DIR}/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch - ) + ${CMAKE_CURRENT_LIST_DIR}/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch + ) endforeach() find_program(NMAKE nmake REQUIRED) @@ -48,9 +49,10 @@ if(TARGET_TRIPLET MATCHES "x64") endif() if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - list(APPEND NMAKE_OPTIONS - PROJ_FLAGS=-DPROJ_STATIC - ) + list(APPEND NMAKE_OPTIONS PROJ_FLAGS=-DPROJ_STATIC) +else() + # Enables PDBs for release and debug builds + list(APPEND NMAKE_OPTIONS WITH_PDB=1) endif() if (VCPKG_CRT_LINKAGE STREQUAL static) @@ -117,6 +119,10 @@ else() file(GLOB EXE_FILES ${CURRENT_PACKAGES_DIR}/bin/*.exe) file(REMOVE ${EXE_FILES} ${CURRENT_PACKAGES_DIR}/lib/gdal.lib) endif() + +# Copy over PDBs +vcpkg_copy_pdbs() + # Handle copyright file(RENAME ${CURRENT_PACKAGES_DIR}/share/gdal/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/gdal/copyright)