Skip to content

Commit

Permalink
Add ability to build static libraries and copy correct license file
Browse files Browse the repository at this point in the history
  • Loading branch information
muemart committed Oct 13, 2016
1 parent 7561bbd commit eb2a2e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ports/libiconv/0001-Add-export-definitions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ index 0feb068..74e5613 100644
+++ "b/include/iconv.h.build.in"
@@ -27,6 +27,12 @@
#define LIBICONV_DLL_EXPORTED __attribute__((__visibility__("default")))
+#elif defined(_WIN32)
+#elif defined(_WIN32) && @LIBICONV_DYNAMIC@
+ #if defined(libiconv_EXPORTS)
+ #define LIBICONV_DLL_EXPORTED __declspec(dllexport)
+ #else
Expand All @@ -21,7 +21,7 @@ index c691359..2a23585 100644
+++ "b/libcharset/include/localcharset.h.build.in"
@@ -24,6 +24,12 @@
#define LIBCHARSET_DLL_EXPORTED __attribute__((__visibility__("default")))
+#elif defined(_WIN32)
+#elif defined(_WIN32) && @LIBICONV_DYNAMIC@
+ #if defined(libcharset_EXPORTS)
+ #define LIBCHARSET_DLL_EXPORTED __declspec(dllexport)
+ #else
Expand Down
6 changes: 5 additions & 1 deletion ports/libiconv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ project(Libiconv)
#
# Options
#
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries, Always ON since this code is LGPL" FORCE)

# Config file
configure_file(
${Libiconv_SOURCE_DIR}/config.h.in
${Libiconv_BINARY_DIR}/config.h
)

if(BUILD_SHARED_LIBS)
set(LIBICONV_DYNAMIC "1 /*LIBICONV_DYNAMIC*/")
else()
set(LIBICONV_DYNAMIC "0 /*LIBICONV_DYNAMIC*/")
endif()
set(HAVE_WCHAR_T "1 /*HAVE_WCHAR_T*/")
set(USE_MBSTATE_T "0 /*USE_MBSTATE_T*/")
set(BROKEN_WCHAR_H "0 /*BROKEN_WCHAR_H*/")
Expand Down
5 changes: 3 additions & 2 deletions ports/libiconv/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(${CMAKE_TRIPLET_FILE})
include(vcpkg_common_functions)
vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz"
Expand All @@ -22,8 +23,8 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()

# Handle copyright
file(COPY ${CURRENT_BUILDTREES_DIR}/src/libiconv-1.14/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libiconv)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libiconv/COPYING ${CURRENT_PACKAGES_DIR}/share/libiconv/copyright)
file(COPY ${CURRENT_BUILDTREES_DIR}/src/libiconv-1.14/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libiconv)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libiconv/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/libiconv/copyright)

# clean out the debug include
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

0 comments on commit eb2a2e3

Please sign in to comment.