Skip to content

Commit c93139b

Browse files
committed
build: add dependency on Foundation
Now that Foundation is required for SwiftSyntax, add the ability to tie together build trees and bootstrap SwiftSyntax. This is required to repair the Windows build.
1 parent 79c8e55 commit c93139b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
2323

2424
set(CMAKE_MACOSX_RPATH YES)
2525

26+
find_package(dispatch QUIET)
27+
find_package(Foundation QUIET)
28+
2629
add_subdirectory(Sources)
2730

2831
export(EXPORT SwiftSyntaxTargets

Sources/SwiftSyntaxBuilder/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ target_link_libraries(SwiftSyntaxBuilder PUBLIC
2727
SwiftBasicFormat
2828
SwiftParser
2929
SwiftParserDiagnostics
30-
SwiftSyntax
31-
)
30+
SwiftSyntax)
31+
if(TARGET Foundation AND TARGET dispatch)
32+
target_link_libraries(SwiftSyntaxBuilder PRIVATE
33+
$<$<NOT:$<PLATFORM:Darwin>>:dispatch>
34+
$<$<NOT:$<PLATFORM:Darwin>>:Foundation>)
35+
endif()
3236

3337
set_property(GLOBAL APPEND PROPERTY SWIFTSYNTAX_EXPORTS SwiftSyntaxBuilder)
3438

0 commit comments

Comments
 (0)