Skip to content

Commit f8f1e81

Browse files
committed
[lldb][cmake] Fix build with GCC 4.8 and wchar-enabled libedit
Fixes PR43229. Patch By: Joseph Tremoulet llvm-svn: 374511
1 parent 1ffbfab commit f8f1e81

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include(CheckIncludeFileCXX)
12
include(CheckCXXSymbolExists)
23
include(CheckTypeSize)
34

@@ -94,10 +95,14 @@ else()
9495
find_package(LibEdit REQUIRED)
9596

9697
# Check if we libedit capable of handling wide characters (built with
97-
# '--enable-widec').
98+
# '--enable-widec'), and have the <codecvt> standard library we use to
99+
# process them.
98100
set(CMAKE_REQUIRED_LIBRARIES ${libedit_LIBRARIES})
99101
set(CMAKE_REQUIRED_INCLUDES ${libedit_INCLUDE_DIRS})
100-
check_symbol_exists(el_winsertstr histedit.h LLDB_EDITLINE_USE_WCHAR)
102+
check_symbol_exists(el_winsertstr histedit.h HAVE_WIDEC_LIBEDIT)
103+
if (HAVE_WIDEC_LIBEDIT)
104+
check_include_file_cxx(codecvt LLDB_EDITLINE_USE_WCHAR)
105+
endif()
101106
set(CMAKE_EXTRA_INCLUDE_FILES histedit.h)
102107
check_type_size(el_rfunc_t LLDB_EL_RFUNC_T_SIZE)
103108
if (LLDB_EL_RFUNC_T_SIZE STREQUAL "")

0 commit comments

Comments
 (0)