aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-01-20 14:47:06 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-01-20 14:47:06 -0800
commit83dcda1e11ae12c9e56c7e4664f6d7f64f961ee6 (patch)
tree7a06dfd181a6fde3507c4086d55efc6ead603819
parent083dfc4d9cebd816b870186d10fbf591c1f13807 (diff)
downloadvcpkg-83dcda1e11ae12c9e56c7e4664f6d7f64f961ee6.tar.gz
vcpkg-83dcda1e11ae12c9e56c7e4664f6d7f64f961ee6.zip
[lzo] Fix compiler error. Add support for non-static triplets.
-rw-r--r--ports/lzo/do-not-declare-setargv.patch17
-rw-r--r--ports/lzo/portfile.cmake16
2 files changed, 33 insertions, 0 deletions
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