Skip to content
Closed
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
10 changes: 10 additions & 0 deletions tools/SourceKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -507,5 +507,15 @@ include_directories(BEFORE
${SOURCEKIT_SOURCE_DIR}/include
)

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
include_directories(AFTER ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})

add_library(dispatch SHARED IMPORTED)
set_target_properties(dispatch PROPERTIES
IMPORTED_LOCATION ${SWIFT_PATH_TO_LIBDISPATCH_BUILD}/src/.libs/libdispatch.so)

set(SOURCEKIT_NEED_EXPLICIT_LIBDISPATCH TRUE)
endif()

add_subdirectory(lib)
add_subdirectory(tools)
16 changes: 10 additions & 6 deletions tools/SourceKit/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(SourceKitSupport_sources
Concurrency-libdispatch.cpp
FuzzyStringMatcher.cpp
Logging.cpp
ImmutableTextBuffer.cpp
Expand All @@ -7,14 +8,17 @@ set(SourceKitSupport_sources
UIDRegistry.cpp
)

set(SourceKitSupport_Darwin_sources
Concurrency-Mac.cpp)
set(LLVM_OPTIONAL_SOURCES ${SourceKitSupport_Darwin_sources})
if(APPLE)
list(APPEND SourceKitSupport_sources ${SourceKitSupport_Darwin_sources})
set(SOURCEKIT_SUPPORT_DEPEND swiftBasic clangBasic clangRewrite)
if(SOURCEKIT_NEED_EXPLICIT_LIBDISPATCH)
list(APPEND SOURCEKIT_SUPPORT_DEPEND dispatch)
endif()

set(SOURCEKIT_SUPPORT_DEPEND swiftBasic clangBasic clangRewrite)
if(SOURCEKIT_NEED_EXPLICIT_LIBDISPATCH)
list(APPEND SOURCEKIT_SUPPORT_DEPEND dispatch BlocksRuntime)
endif()

add_sourcekit_library(SourceKitSupport
${SourceKitSupport_sources}
DEPENDS swiftBasic clangBasic clangRewrite
DEPENDS ${SOURCEKIT_SUPPORT_DEPEND}
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- Concurrency-Mac.cpp ----------------------------------------------===//
//===--- Concurrency-libdispatch.cpp --------------------------------------===//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent rename, thanks!

//
// This source file is part of the Swift.org open source project
//
Expand Down
4 changes: 4 additions & 0 deletions tools/SourceKit/tools/complete-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ else()
set(SOURCEKITD_TEST_DEPEND sourcekitd)
endif()

if(SOURCEKIT_NEED_EXPLICIT_LIBDISPATCH)
set(SOURCEKITD_TEST_DEPEND ${SOURCEKITD_TEST_DEPEND} dispatch)
endif()

add_sourcekit_executable(complete-test
complete-test.cpp
DEPENDS ${SOURCEKITD_TEST_DEPEND}
Expand Down
4 changes: 4 additions & 0 deletions tools/SourceKit/tools/sourcekitd-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ else()
set(SOURCEKITD_TEST_DEPEND sourcekitd)
endif()

if(SOURCEKIT_NEED_EXPLICIT_LIBDISPATCH)
set(SOURCEKITD_TEST_DEPEND ${SOURCEKITD_TEST_DEPEND} dispatch)
endif()

add_sourcekit_executable(sourcekitd-test
sourcekitd-test.cpp
TestOptions.cpp
Expand Down
4 changes: 4 additions & 0 deletions tools/SourceKit/tools/sourcekitd/bin/InProc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ else()
)
endif()

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
target_link_libraries(sourcekitdInProc PUBLIC BlocksRuntime)
endif()

if (SOURCEKIT_BUILT_STANDALONE)
# Create the symlinks necessary to find the swift runtime.
add_custom_command(TARGET sourcekitdInProc PRE_BUILD
Expand Down
2 changes: 2 additions & 0 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,8 @@ for host in "${ALL_HOSTS[@]}"; do
-DSWIFT_PATH_TO_LLVM_BUILD:PATH="${llvm_build_dir}"
-DSWIFT_PATH_TO_CMARK_SOURCE:PATH="${CMARK_SOURCE_DIR}"
-DSWIFT_PATH_TO_CMARK_BUILD:PATH="$(build_directory ${host} cmark)"
-DSWIFT_PATH_TO_LIBDISPATCH_SOURCE:PATH="${LIBDISPATCH_SOURCE_DIR}"
-DSWIFT_PATH_TO_LIBDISPATCH_BUILD:PATH="$(build_directory ${host} libdispatch)"
)

if [[ "${CMAKE_GENERATOR}" == "Xcode" ]] ; then
Expand Down