Skip to content

Commit 5e514ee

Browse files
committed
[CMake] Disable the new Swift Swift parser if we can't find its targets file
This allows us to more gracefully degrade when a host Swift toolchain can't be found, and the early SwiftSyntax build is skipped as a result.
1 parent 76d733c commit 5e514ee

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lldb/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ endif()
4545

4646
# When we have the early SwiftSyntax build, we can include its parser.
4747
if(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR)
48-
set(SWIFT_SWIFT_PARSER TRUE)
49-
include(${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/cmake/SwiftSyntaxTargets.cmake)
48+
set(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS
49+
${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/cmake/SwiftSyntaxTargets.cmake)
50+
if(NOT EXISTS "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS}")
51+
message(STATUS "Skipping Swift Swift parser integration due to missing early SwiftSyntax")
52+
else()
53+
set(SWIFT_SWIFT_PARSER TRUE)
54+
include(${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS})
55+
endif()
5056
endif()
5157
# END - Swift Mods
5258

0 commit comments

Comments
 (0)