Skip to content

[cmake] Attempt to update the build files for recent changes #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2020
Merged
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
1 change: 1 addition & 0 deletions Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ add_subdirectory(SKCore)
add_subdirectory(SKSupport)
add_subdirectory(SKSwiftPMWorkspace)
add_subdirectory(SourceKit)
add_subdirectory(SourceKitD)
add_subdirectory(sourcekit-lsp)
3 changes: 2 additions & 1 deletion Sources/SKCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ add_library(SKCore
BuildSetup.swift
BuildSystem.swift
BuildSystemDelegate.swift
BuildSystemList.swift
BuildSystemManager.swift
CompilationDatabase.swift
CompilationDatabaseBuildSystem.swift
FallbackBuildSystem.swift
FileBuildSettings.swift
FileBuildSettingsChange.swift
LanguageServer.swift
MainFilesProvider.swift
Toolchain.swift
Expand All @@ -28,6 +28,7 @@ target_link_libraries(SKCore PRIVATE
LanguageServerProtocol
LanguageServerProtocolJSONRPC
SKSupport
SourceKitD
TSCUtility)

if(BUILD_SHARED_LIBS)
Expand Down
21 changes: 11 additions & 10 deletions Sources/SourceKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ add_library(SourceKit
ToolchainLanguageServer.swift
Workspace.swift)
target_sources(SourceKit PRIVATE
clangd/ClangLanguageServer.swift)
Clang/ClangLanguageServer.swift)
target_sources(SourceKit PRIVATE
sourcekitd/CommentXML.swift
sourcekitd/CursorInfo.swift
sourcekitd/Diagnostic.swift
sourcekitd/EditorPlaceholder.swift
sourcekitd/SemanticRefactorCommand.swift
sourcekitd/SemanticRefactoring.swift
sourcekitd/SwiftCommand.swift
sourcekitd/SwiftLanguageServer.swift
sourcekitd/SwiftSourceKitFramework.swift)
Swift/CommentXML.swift
Swift/CursorInfo.swift
Swift/Diagnostic.swift
Swift/EditorPlaceholder.swift
Swift/SemanticRefactorCommand.swift
Swift/SemanticRefactoring.swift
Swift/SourceKitD+ResponseError.swift
Swift/SwiftCommand.swift
Swift/SwiftLanguageServer.swift)
set_target_properties(SourceKit PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
# TODO(compnerd) reduce the exposure here, why is everything PUBLIC-ly linked?
Expand All @@ -37,6 +37,7 @@ target_link_libraries(SourceKit PUBLIC
LanguageServerProtocolJSONRPC
SKCore
SKSwiftPMWorkspace
SourceKitD
TSCUtility)

if(BUILD_SHARED_LIBS)
Expand Down
37 changes: 37 additions & 0 deletions Sources/SourceKitD/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
if(CMAKE_VERSION VERSION_LESS 3.16)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_LINK_LIBRARY_FLAG "-l")
set(CMAKE_LINK_LIBRARY_SUFFIX "")
endif()
endif()

add_library(SourceKitD
SKDRequestArray.swift
SKDRequestDictionary.swift
SKDResponse.swift
SKDResponseArray.swift
SKDResponseDictionary.swift
SourceKitD.swift
SourceKitDImpl.swift
SourceKitDRegistry.swift
sourcekitd_functions.swift
sourcekitd_uids.swift)
set_target_properties(SourceKitD PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
target_link_libraries(SourceKitD PRIVATE
Csourcekitd
LSPLogging
SKSupport
TSCUtility)

if(BUILD_SHARED_LIBS)
get_swift_host_arch(swift_arch)
install(TARGETS SourceKitD
ARCHIVE DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
LIBRARY DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
RUNTIME DESTINATION bin)
install(FILES
$<TARGET_PROPERTY:SourceKitD,Swift_MODULE_DIRECTORY>/SourceKitD.swiftdoc
$<TARGET_PROPERTY:SourceKitD,Swift_MODULE_DIRECTORY>/SourceKitD.swiftmodule
DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch})
endif()