Skip to content

Commit 0f8e018

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 0f8e018

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CMakeLists.txt

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

2424
set(CMAKE_MACOSX_RPATH YES)
2525

26+
find_package(Foundation QUIET)
27+
2628
add_subdirectory(Sources)
2729

2830
export(EXPORT SwiftSyntaxTargets

Sources/SwiftSyntaxBuilder/CMakeLists.txt

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

3336
set_property(GLOBAL APPEND PROPERTY SWIFTSYNTAX_EXPORTS SwiftSyntaxBuilder)
3437

0 commit comments

Comments
 (0)