1 # SPDX-License-Identifier: 0BSD
3 #############################################################################
5 # tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments
9 #############################################################################
11 include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
12 include(CheckSymbolExists)
14 function(tuklib_mbstr TARGET_OR_ALL)
15 check_symbol_exists(mbrtowc wchar.h HAVE_MBRTOWC)
16 tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_MBRTOWC)
18 # NOTE: wcwidth() requires _GNU_SOURCE or _XOPEN_SOURCE on GNU/Linux.
19 check_symbol_exists(wcwidth wchar.h HAVE_WCWIDTH)
20 tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_WCWIDTH)