Skip to content

Commit 9d8a5d4

Browse files
authored
Merge pull request #283 from benlangmuir/cmake-up
[cmake] Attempt to update the build files for recent changes
2 parents f40f610 + 8520c8d commit 9d8a5d4

File tree

4 files changed

+51
-11
lines changed

4 files changed

+51
-11
lines changed

Sources/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ add_subdirectory(SKCore)
77
add_subdirectory(SKSupport)
88
add_subdirectory(SKSwiftPMWorkspace)
99
add_subdirectory(SourceKit)
10+
add_subdirectory(SourceKitD)
1011
add_subdirectory(sourcekit-lsp)

Sources/SKCore/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ add_library(SKCore
1010
BuildSetup.swift
1111
BuildSystem.swift
1212
BuildSystemDelegate.swift
13-
BuildSystemList.swift
1413
BuildSystemManager.swift
1514
CompilationDatabase.swift
1615
CompilationDatabaseBuildSystem.swift
1716
FallbackBuildSystem.swift
1817
FileBuildSettings.swift
18+
FileBuildSettingsChange.swift
1919
LanguageServer.swift
2020
MainFilesProvider.swift
2121
Toolchain.swift
@@ -28,6 +28,7 @@ target_link_libraries(SKCore PRIVATE
2828
LanguageServerProtocol
2929
LanguageServerProtocolJSONRPC
3030
SKSupport
31+
SourceKitD
3132
TSCUtility)
3233

3334
if(BUILD_SHARED_LIBS)

Sources/SourceKit/CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ add_library(SourceKit
1515
ToolchainLanguageServer.swift
1616
Workspace.swift)
1717
target_sources(SourceKit PRIVATE
18-
clangd/ClangLanguageServer.swift)
18+
Clang/ClangLanguageServer.swift)
1919
target_sources(SourceKit PRIVATE
20-
sourcekitd/CommentXML.swift
21-
sourcekitd/CursorInfo.swift
22-
sourcekitd/Diagnostic.swift
23-
sourcekitd/EditorPlaceholder.swift
24-
sourcekitd/SemanticRefactorCommand.swift
25-
sourcekitd/SemanticRefactoring.swift
26-
sourcekitd/SwiftCommand.swift
27-
sourcekitd/SwiftLanguageServer.swift
28-
sourcekitd/SwiftSourceKitFramework.swift)
20+
Swift/CommentXML.swift
21+
Swift/CursorInfo.swift
22+
Swift/Diagnostic.swift
23+
Swift/EditorPlaceholder.swift
24+
Swift/SemanticRefactorCommand.swift
25+
Swift/SemanticRefactoring.swift
26+
Swift/SourceKitD+ResponseError.swift
27+
Swift/SwiftCommand.swift
28+
Swift/SwiftLanguageServer.swift)
2929
set_target_properties(SourceKit PROPERTIES
3030
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
3131
# TODO(compnerd) reduce the exposure here, why is everything PUBLIC-ly linked?
@@ -37,6 +37,7 @@ target_link_libraries(SourceKit PUBLIC
3737
LanguageServerProtocolJSONRPC
3838
SKCore
3939
SKSwiftPMWorkspace
40+
SourceKitD
4041
TSCUtility)
4142

4243
if(BUILD_SHARED_LIBS)

Sources/SourceKitD/CMakeLists.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
if(CMAKE_VERSION VERSION_LESS 3.16)
2+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
3+
set(CMAKE_LINK_LIBRARY_FLAG "-l")
4+
set(CMAKE_LINK_LIBRARY_SUFFIX "")
5+
endif()
6+
endif()
7+
8+
add_library(SourceKitD
9+
SKDRequestArray.swift
10+
SKDRequestDictionary.swift
11+
SKDResponse.swift
12+
SKDResponseArray.swift
13+
SKDResponseDictionary.swift
14+
SourceKitD.swift
15+
SourceKitDImpl.swift
16+
SourceKitDRegistry.swift
17+
sourcekitd_functions.swift
18+
sourcekitd_uids.swift)
19+
set_target_properties(SourceKitD PROPERTIES
20+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
21+
target_link_libraries(SourceKitD PRIVATE
22+
Csourcekitd
23+
LSPLogging
24+
SKSupport
25+
TSCUtility)
26+
27+
if(BUILD_SHARED_LIBS)
28+
get_swift_host_arch(swift_arch)
29+
install(TARGETS SourceKitD
30+
ARCHIVE DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
31+
LIBRARY DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
32+
RUNTIME DESTINATION bin)
33+
install(FILES
34+
$<TARGET_PROPERTY:SourceKitD,Swift_MODULE_DIRECTORY>/SourceKitD.swiftdoc
35+
$<TARGET_PROPERTY:SourceKitD,Swift_MODULE_DIRECTORY>/SourceKitD.swiftmodule
36+
DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch})
37+
endif()

0 commit comments

Comments
 (0)