Skip to content

[build] Check for unicode functions in libedit #29115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,19 @@ else()
find_package(LibEdit)
endif()

if(LibEdit_FOUND)
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES ${LibEdit_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LibEdit_LIBRARIES})
check_symbol_exists(el_wgets "histedit.h" HAVE_EL_WGETS)
if(HAVE_EL_WGETS)
set(LibEdit_HAS_UNICODE YES)
else()
set(LibEdit_HAS_UNICODE NO)
endif()
cmake_pop_check_state()
endif()

check_symbol_exists(wait4 "sys/wait.h" HAVE_WAIT4)

check_symbol_exists(proc_pid_rusage "libproc.h" HAVE_PROC_PID_RUSAGE)
Expand Down
2 changes: 1 addition & 1 deletion lib/Immediate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ target_link_libraries(swiftImmediate PRIVATE
swiftIRGen
swiftSILGen
swiftSILOptimizer)
if(LibEdit_FOUND)
if(LibEdit_FOUND AND LibEdit_HAS_UNICODE)
target_compile_definitions(swiftImmediate PRIVATE
HAVE_LIBEDIT)
target_link_libraries(swiftImmediate PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include_directories(

add_swift_lib_subdirectory(sourcekitd)
add_swift_tool_subdirectory(sourcekitd-test)
if(LibEdit_FOUND)
if(LibEdit_FOUND AND LibEdit_HAS_UNICODE)
add_swift_tool_subdirectory(sourcekitd-repl)
endif()
add_swift_tool_subdirectory(complete-test)
Expand Down