cmake/Modules/FindIconv.cmake


Log

Author Commit Date CI Message
Patrick Steinhardt 2e2d8c64 2018-08-24T09:53:39 cmake: detect and use libc-provided iconv While most systems provide a separate iconv library against which applications can link, musl based systems do not provide such a library. Instead, iconv functions are directly included in the C library. As our current CMake module to locate the iconv library only checks whether a library exists somewhere in the typical library directories, we will never build libgit2 with libiconv support on such systems. Extend the iconv module to also search whether libc provides iconv functions, which we do by checking whether the `iconv_open` function exists inside of libc. If this is the case, we will default to use the libc provided one instead of trying to use a separate libiconv. While this changes which iconv we use on systems where both libc and an external libiconv exist, to the best of my knowledge common systems only provide either one or the other. Note that libiconv support in musl is held kind of basic. To quote musl libc's page on functional differences from glibc [1]: The iconv implementation musl is very small and oriented towards being unobtrusive to static link. Its character set/encoding coverage is very strong for its size, but not comprehensive like glibc’s. As we assume iconv to be a lot more capable than what musl provides, some of our tests will fail if using iconv on musl-based platforms. [1]: https://wiki.musl-libc.org/functional-differences-from-glibc.html
Jiří Techet b7df2e8b 2015-05-01T22:48:33 Don't search iconv in /opt/local Since OpenSSL isn't used any more on OS X, there is no dependency on any MacPorts library under /opt/local and there is no danger of conflicts between MacPorts and system iconv. For this reason the system iconv can always be used now.
Sascha Cunz 4bc94eb5 2014-01-30T03:01:46 We never search for libiconv via pkg-config So we actually also never know that we can set a dependency on it in pkg-config. Instead always give it the -L and -l options.
Sascha Cunz 6e0ff093 2014-01-30T02:30:55 Find and use a MacPorts version of libiconv. Fixes #2017. - Add correct -I, -L and -l flags - Search for libiconv in /opt/local/[include|lib] before in the system path. See #2017 for details. - Give splitted -L and -l arguments to pkg-config
Sascha Cunz 39949f06 2014-01-30T02:28:53 Cleanup FindIconv.cmake Doesn't change anything. Just removes stuff that was probably missed to remove when this was imported.
Russell Belfer 726b75d1 2013-12-02T11:32:37 Improve iconv finding for cmake * add FindIconv helper for CMake iconv detection * only default using iconv to ON for MacOS * update pkg-config generation to include iconv dependency better