diff --git a/ports/libiconv/0001-Add-export-definitions.patch b/ports/libiconv/0001-Add-export-definitions.patch index 3508e8f52e9a03..c59d15d9e06ac1 100644 --- a/ports/libiconv/0001-Add-export-definitions.patch +++ b/ports/libiconv/0001-Add-export-definitions.patch @@ -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 @@ -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 diff --git a/ports/libiconv/CMakeLists.txt b/ports/libiconv/CMakeLists.txt index 5ef46f07d23ce9..46575ca2738134 100644 --- a/ports/libiconv/CMakeLists.txt +++ b/ports/libiconv/CMakeLists.txt @@ -9,7 +9,6 @@ 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( @@ -17,6 +16,11 @@ configure_file( ${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*/") diff --git a/ports/libiconv/portfile.cmake b/ports/libiconv/portfile.cmake index e74d5ff2150c27..dc1e1a3a3a4cb9 100644 --- a/ports/libiconv/portfile.cmake +++ b/ports/libiconv/portfile.cmake @@ -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" @@ -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) \ No newline at end of file