Skip to content

Commit 6df9c68

Browse files
authored
Merge pull request #328 from compnerd/staged
build: allow building with dispatch and Foundation from the toolchain
2 parents 833b36c + 67aaa09 commit 6df9c68

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

Sources/LSPLogging/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ add_library(LSPLogging
44
set_target_properties(LSPLogging PROPERTIES
55
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
66
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
7-
target_link_libraries(LSPLogging PRIVATE
8-
Foundation)
7+
if(Foundation_FOUND)
8+
target_link_libraries(LSPLogging PRIVATE
9+
Foundation)
10+
endif()
911
endif()
1012

1113
if(BUILD_SHARED_LIBS)

Sources/LanguageServerProtocol/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,14 @@ add_library(LanguageServerProtocol
7474
set_target_properties(LanguageServerProtocol PROPERTIES
7575
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
7676
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
77-
target_link_libraries(LanguageServerProtocol PUBLIC
78-
swiftDispatch
79-
Foundation)
77+
if(dispatch_FOUND)
78+
target_link_libraries(LanguageServerProtocol PUBLIC
79+
swiftDispatch)
80+
endif()
81+
if(Foundation_FOUND)
82+
target_link_libraries(LanguageServerProtocol PUBLIC
83+
Foundation)
84+
endif()
8085
endif()
8186

8287
if(BUILD_SHARED_LIBS)

Sources/SourceKitLSP/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ target_link_libraries(SourceKitLSP PUBLIC
4242
SourceKitD
4343
TSCUtility)
4444
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
45-
target_link_libraries(SourceKitLSP PRIVATE
46-
FoundationXML)
45+
if(Foundation_FOUND)
46+
target_link_libraries(SourceKitLSP PRIVATE
47+
FoundationXML)
48+
endif()
4749
endif()
4850

4951
if(BUILD_SHARED_LIBS)

Sources/sourcekit-lsp/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ target_link_libraries(sourcekit-lsp PRIVATE
1313
SourceKitLSP
1414
TSCUtility)
1515
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
16-
target_link_libraries(sourcekit-lsp PRIVATE
17-
FoundationXML)
16+
if(Foundation_FOUND)
17+
target_link_libraries(sourcekit-lsp PRIVATE
18+
FoundationXML)
19+
endif()
1820
endif()
1921

2022
install(TARGETS sourcekit-lsp

0 commit comments

Comments
 (0)