aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2019-11-22 14:56:43 -0800
committerGitHub <noreply@github.com>2019-11-22 14:56:43 -0800
commitea5a57338ea8cee8fc1c5dc2ef750c4ee76afdf8 (patch)
treea9f942c2eaf26c408a09c5a8130581ee39383e70
parent776fcf76db997393381f0e0cc780491edc06aa34 (diff)
parent23b16cc4a0de1bf8cdee5cf8a445874222d98d28 (diff)
downloadvcpkg-ea5a57338ea8cee8fc1c5dc2ef750c4ee76afdf8.tar.gz
vcpkg-ea5a57338ea8cee8fc1c5dc2ef750c4ee76afdf8.zip
Merge pull request #9042 from NancyLi1013/dev/NancyLi/4848-add-usage-for-pdcurses
[pdcurses] Fix linkage error
-rw-r--r--ports/pdcurses/CONTROL2
-rw-r--r--ports/pdcurses/portfile.cmake21
2 files changed, 13 insertions, 10 deletions
diff --git a/ports/pdcurses/CONTROL b/ports/pdcurses/CONTROL
index 928000072..59ad72513 100644
--- a/ports/pdcurses/CONTROL
+++ b/ports/pdcurses/CONTROL
@@ -1,4 +1,4 @@
Source: pdcurses
-Version: 3.8-1
+Version: 3.8-2
Homepage: https://sourceforge.net/projects/pdcurses/
Description: Public Domain Curses - a curses library for environments that don't fit the termcap/terminfo model.
diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake
index a1c76fda3..98ceaee26 100644
--- a/ports/pdcurses/portfile.cmake
+++ b/ports/pdcurses/portfile.cmake
@@ -1,9 +1,5 @@
+vcpkg_check_linkage(ONLY_DYNAMIC_CRT)
-if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic")
- message(FATAL_ERROR "PDCurses only supports dynamic CRT linkage")
-endif()
-
-include(vcpkg_common_functions)
find_program(NMAKE nmake)
vcpkg_from_github(
@@ -51,20 +47,27 @@ vcpkg_execute_required_process(
message(STATUS "Build ${TARGET_TRIPLET}-dbg done")
file (
- COPY ${PDC_PDCLIB}.lib
+ INSTALL ${PDC_PDCLIB}.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file (
- COPY ${PDC_PDCLIB}.dll
+ INSTALL ${PDC_PDCLIB}.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
endif()
file(
- COPY ${SOURCE_PATH}/curses.h ${SOURCE_PATH}/panel.h
+ INSTALL ${SOURCE_PATH}/curses.h ${SOURCE_PATH}/panel.h
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ file(READ ${CURRENT_PACKAGES_DIR}/include/curses.h _contents)
+ string(REPLACE "#ifdef PDC_DLL_BUILD" "#if 1" _contents "${_contents}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/include/curses.h "${_contents}")
+endif()
+
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pdcurses RENAME copyright)
-vcpkg_copy_pdbs()
+vcpkg_copy_pdbs() \ No newline at end of file