Skip to content

Commit 0328e39

Browse files
authored
Merge pull request #3079 from briancroom/sourcekitd-repl-needs-unicode-libedit
[SourceKit] Only build sourcekitd-repl if a unicode-aware libedit is present
2 parents 8a16921 + 6c1f8dd commit 0328e39

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed
Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
2-
set(SOURCEKITD_REPL_DEPEND sourcekitdInProc)
3-
else()
4-
set(SOURCEKITD_REPL_DEPEND sourcekitd)
5-
endif()
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)
5+
if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
6+
set(SOURCEKITD_REPL_DEPEND sourcekitdInProc)
7+
else()
8+
set(SOURCEKITD_REPL_DEPEND sourcekitd)
9+
endif()
610

7-
add_sourcekit_executable(sourcekitd-repl
8-
sourcekitd-repl.cpp
9-
DEPENDS ${SOURCEKITD_REPL_DEPEND} edit
10-
COMPONENT_DEPENDS support
11-
)
11+
add_sourcekit_executable(sourcekitd-repl
12+
sourcekitd-repl.cpp
13+
DEPENDS ${SOURCEKITD_REPL_DEPEND} edit
14+
COMPONENT_DEPENDS support
15+
)
1216

13-
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
14-
set_target_properties(sourcekitd-repl
15-
PROPERTIES
16-
LINK_FLAGS "-Wl,-rpath -Wl,@executable_path/../lib")
17+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
18+
set_target_properties(sourcekitd-repl
19+
PROPERTIES
20+
LINK_FLAGS "-Wl,-rpath -Wl,@executable_path/../lib")
1721

18-
if(SWIFT_ANALYZE_CODE_COVERAGE)
19-
set_property(TARGET sourcekitd-repl APPEND_STRING PROPERTY
20-
LINK_FLAGS " -fprofile-instr-generate -fcoverage-mapping")
22+
if(SWIFT_ANALYZE_CODE_COVERAGE)
23+
set_property(TARGET sourcekitd-repl APPEND_STRING PROPERTY
24+
LINK_FLAGS " -fprofile-instr-generate -fcoverage-mapping")
25+
endif()
2126
endif()
22-
endif()
2327

24-
swift_install_in_component(tools
25-
TARGETS sourcekitd-repl
26-
RUNTIME DESTINATION bin)
28+
swift_install_in_component(tools
29+
TARGETS sourcekitd-repl
30+
RUNTIME DESTINATION bin)
31+
endif()

0 commit comments

Comments
 (0)