Skip to content

Commit b409041

Browse files
committed
[cmake] Modify libedit target name to match LLVM's FindLibEdit
For unified builds, LLVM with the update to stable/20221013 includes its own FindLibEdit, which shares many of the same names than Swift's FindLibEdit, except that they differ in the target name. Match both LLVM and Swift target names, so unified builds can find LibEdit::LibEdit correctly and not try to link against libedit mistakenly. This should not affect Darwin/Linux builds from upstream Swift, since they build non-unified in most people setups (including CI).
1 parent 0473879 commit b409041

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmake/modules/FindLibEdit.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ else()
6161
LibEdit_VERSION_STRING)
6262
endif()
6363

64-
if(LibEdit_FOUND AND NOT TARGET libedit)
65-
add_library(libedit UNKNOWN IMPORTED)
66-
set_target_properties(libedit PROPERTIES
64+
if(LibEdit_FOUND AND NOT TARGET LibEdit::LibEdit)
65+
add_library(LibEdit::LibEdit UNKNOWN IMPORTED)
66+
set_target_properties(LibEdit::LibEdit PROPERTIES
6767
IMPORTED_LOCATION ${LibEdit_LIBRARIES}
6868
INTERFACE_INCLUDE_DIRECTORIES ${LibEdit_INCLUDE_DIRS})
6969
endif()

tools/SourceKit/tools/sourcekitd-repl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
1313
BlocksRuntime)
1414
endif()
1515
target_link_libraries(sourcekitd-repl PRIVATE
16-
libedit)
16+
LibEdit::LibEdit)
1717

1818
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
1919
set_target_properties(sourcekitd-repl PROPERTIES

0 commit comments

Comments
 (0)