File tree Expand file tree Collapse file tree 7 files changed +17
-82
lines changed Expand file tree Collapse file tree 7 files changed +17
-82
lines changed Original file line number Diff line number Diff line change @@ -915,11 +915,14 @@ else()
915
915
find_package (LibXml2 )
916
916
endif ()
917
917
918
- if (LLVM_ENABLE_LIBEDIT )
919
- find_package (LibEdit REQUIRED )
920
- else ()
921
- find_package (LibEdit )
918
+ # You need libedit linked in order to check if you have el_wgets.
919
+ cmake_push_check_state ()
920
+ list (APPEND CMAKE_REQUIRED_LIBRARIES "edit" )
921
+ check_symbol_exists (el_wgets "histedit.h" HAVE_EL_WGETS )
922
+ if (HAVE_EL_WGETS )
923
+ set (HAVE_UNICODE_LIBEDIT 1 )
922
924
endif ()
925
+ cmake_pop_check_state ()
923
926
924
927
check_symbol_exists (wait4 "sys/wait.h" HAVE_WAIT4 )
925
928
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,9 +5,6 @@ if(SWIFT_BUILD_REMOTE_MIRROR)
5
5
endif ()
6
6
7
7
if (SWIFT_INCLUDE_TOOLS )
8
- if (libedit_FOUND )
9
- set (HAVE_UNICODE_LIBEDIT TRUE )
10
- endif ()
11
8
configure_file (Config.h.in ${CMAKE_CURRENT_BINARY_DIR} /Config.h
12
9
ESCAPE_QUOTES @ONLY )
13
10
add_subdirectory (Option )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ include_directories(
6
6
7
7
add_swift_lib_subdirectory (sourcekitd )
8
8
add_swift_tool_subdirectory (sourcekitd-test )
9
- if (libedit_FOUND )
9
+ if (HAVE_UNICODE_LIBEDIT )
10
10
add_swift_tool_subdirectory (sourcekitd-repl )
11
11
endif ()
12
12
add_swift_tool_subdirectory (complete-test )
Original file line number Diff line number Diff line change 1
- if (libedit_FOUND )
1
+ set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} edit )
2
+ check_symbol_exists (el_wgets "histedit.h" HAVE_UNICODE_LIBEDIT )
3
+
4
+ if (HAVE_UNICODE_LIBEDIT )
2
5
if (SWIFT_SOURCEKIT_USE_INPROC_LIBRARY )
3
6
set (SOURCEKITD_REPL_LINK_LIBS sourcekitdInProc )
4
7
else ()
@@ -7,13 +10,9 @@ if(libedit_FOUND)
7
10
8
11
add_sourcekit_executable (sourcekitd-repl
9
12
sourcekitd-repl.cpp
10
- LINK_LIBS ${SOURCEKITD_REPL_LINK_LIBS}
13
+ LINK_LIBS ${SOURCEKITD_REPL_LINK_LIBS} edit
11
14
LLVM_LINK_COMPONENTS support coverage lto
12
15
)
13
- target_include_directories (sourcekitd-repl PRIVATE
14
- ${libedit_INCLUDE_DIRS} )
15
- target_link_libraries (sourcekitd-repl PRIVATE
16
- ${libedit_LIBRARIES} )
17
16
if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
18
17
target_link_libraries (sourcekitd-repl PRIVATE dispatch BlocksRuntime )
19
18
endif ()
Original file line number Diff line number Diff line change @@ -9,9 +9,8 @@ target_link_libraries(swift
9
9
PRIVATE
10
10
swiftDriver
11
11
swiftFrontendTool )
12
- if (libedit_FOUND )
13
- target_link_libraries (swift PRIVATE
14
- ${libedit_LIBRARIES} )
12
+ if (HAVE_UNICODE_LIBEDIT )
13
+ target_link_libraries (swift PRIVATE edit )
15
14
endif ()
16
15
17
16
swift_create_post_build_symlink (swift
Original file line number Diff line number Diff line change @@ -7,9 +7,8 @@ target_link_libraries(swift-remoteast-test
7
7
swiftFrontendTool
8
8
swiftRemoteAST )
9
9
set_target_properties (swift-remoteast-test PROPERTIES ENABLE_EXPORTS 1 )
10
- if (libedit_FOUND )
11
- target_link_libraries (swift-remoteast-test PRIVATE
12
- ${libedit_LIBRARIES} )
10
+ if (HAVE_UNICODE_LIBEDIT )
11
+ target_link_libraries (swift-remoteast-test PRIVATE edit )
13
12
endif ()
14
13
15
14
# If building as part of clang, make sure the headers are installed.
You can’t perform that action at this time.
0 commit comments