From 76a6f87890b9dc38c3ac78019802fee57f061511 Mon Sep 17 00:00:00 2001 From: Hugh Bellamy Date: Thu, 22 Dec 2016 17:56:02 +0000 Subject: [PATCH] Introduce and use SWIFT_HAVE_LIBEDIT --- CMakeLists.txt | 3 +++ include/swift/CMakeLists.txt | 4 ---- tools/SourceKit/tools/CMakeLists.txt | 4 +++- tools/driver/CMakeLists.txt | 4 +++- tools/swift-remoteast-test/CMakeLists.txt | 4 +++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7b9997160d99..978a162f72596 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set_property(GLOBAL PROPERTY JOB_POOL_LINK local_jobs) # First include general CMake utilities. include(SwiftUtils) +include(CheckSymbolExists) # # User-configurable options that control the inclusion and default build @@ -805,6 +806,8 @@ if(LIBXML2_FOUND) set(SWIFT_HAVE_LIBXML 1) endif() +check_symbol_exists(el_wgets "histedit.h" HAVE_UNICODE_LIBEDIT) + if (LLVM_ENABLE_DOXYGEN) message(STATUS "Doxygen: enabled") endif() diff --git a/include/swift/CMakeLists.txt b/include/swift/CMakeLists.txt index 8211c8ad29840..c64a3fe0685f9 100644 --- a/include/swift/CMakeLists.txt +++ b/include/swift/CMakeLists.txt @@ -1,7 +1,3 @@ -include(CheckSymbolExists) - -check_symbol_exists(el_wgets "histedit.h" HAVE_UNICODE_LIBEDIT) - configure_file(Config.h.in ${CMAKE_CURRENT_BINARY_DIR}/Config.h ESCAPE_QUOTES @ONLY) diff --git a/tools/SourceKit/tools/CMakeLists.txt b/tools/SourceKit/tools/CMakeLists.txt index 182638b794db6..ad0a4fd63718c 100644 --- a/tools/SourceKit/tools/CMakeLists.txt +++ b/tools/SourceKit/tools/CMakeLists.txt @@ -6,5 +6,7 @@ include_directories( add_swift_lib_subdirectory(sourcekitd) add_swift_tool_subdirectory(sourcekitd-test) -add_swift_tool_subdirectory(sourcekitd-repl) +if(HAVE_UNICODE_LIBEDIT) + add_swift_tool_subdirectory(sourcekitd-repl) +endif() add_swift_tool_subdirectory(complete-test) diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index 902b9fe97c4f0..e2f907a8a354f 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -12,7 +12,9 @@ add_swift_host_tool(swift SWIFT_COMPONENT compiler ) -target_link_libraries(swift edit) +if(HAVE_UNICODE_LIBEDIT) + target_link_libraries(swift edit) +endif() add_custom_command(TARGET swift POST_BUILD COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "swift" "swiftc" diff --git a/tools/swift-remoteast-test/CMakeLists.txt b/tools/swift-remoteast-test/CMakeLists.txt index b0c546ed50324..9ae0bb0598b3f 100644 --- a/tools/swift-remoteast-test/CMakeLists.txt +++ b/tools/swift-remoteast-test/CMakeLists.txt @@ -7,7 +7,9 @@ add_swift_host_tool(swift-remoteast-test ) set_target_properties(swift-remoteast-test PROPERTIES ENABLE_EXPORTS 1) -target_link_libraries(swift-remoteast-test edit) +if(HAVE_UNICODE_LIBEDIT) + target_link_libraries(swift-remoteast-test edit) +endif() # If building as part of clang, make sure the headers are installed. if(NOT SWIFT_BUILT_STANDALONE)