From 83dcda1e11ae12c9e56c7e4664f6d7f64f961ee6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 20 Jan 2017 14:47:06 -0800 Subject: [PATCH] [lzo] Fix compiler error. Add support for non-static triplets. --- ports/lzo/do-not-declare-setargv.patch | 17 +++++++++++++++++ ports/lzo/portfile.cmake | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 ports/lzo/do-not-declare-setargv.patch diff --git a/ports/lzo/do-not-declare-setargv.patch b/ports/lzo/do-not-declare-setargv.patch new file mode 100644 index 000000000..48ae31514 --- /dev/null +++ b/ports/lzo/do-not-declare-setargv.patch @@ -0,0 +1,17 @@ +diff --git a/src/lzo_supp.h b/src/lzo_supp.h +index 87307f9..f94a6b0 100644 +--- a/src/lzo_supp.h ++++ b/src/lzo_supp.h +@@ -3643,9 +3643,9 @@ LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } + #endif + #if (LZO_OS_WIN32 || LZO_OS_WIN64) + #if (LZO_CC_INTELC || LZO_CC_MSC) +-LZO_EXTERN_C int __lzo_cdecl __setargv(void); +-LZO_EXTERN_C int __lzo_cdecl _setargv(void); +-LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } ++// LZO_EXTERN_C int __lzo_cdecl __setargv(void); ++// LZO_EXTERN_C int __lzo_cdecl _setargv(void); ++// LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } + #endif + #endif + #if (LZO_OS_EMX) diff --git a/ports/lzo/portfile.cmake b/ports/lzo/portfile.cmake index a8a91e5e5..227ef7ee0 100644 --- a/ports/lzo/portfile.cmake +++ b/ports/lzo/portfile.cmake @@ -15,8 +15,24 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/do-not-declare-setargv.patch" +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(ENABLE_STATIC ON) + set(ENABLE_SHARED OFF) +else() + set(ENABLE_STATIC OFF) + set(ENABLE_SHARED ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_STATIC=${ENABLE_STATIC} + -DENABLE_SHARED=${ENABLE_SHARED} # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1