Skip to content

Commit bb5b77e

Browse files
Merge pull request #68527 from kateinoigakukun/katei/fix-use-bef-def-bootstrap
2 parents 7a499de + 06bffb9 commit bb5b77e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

CMakeLists.txt

+18-18
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,24 @@ elseif(BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS" OR SWIFT_SWIFT_PARSER)
838838
set(SWIFT_EXEC_FOR_SWIFT_MODULES "${CMAKE_Swift_COMPILER}")
839839
endif()
840840

841+
# When we have the early SwiftSyntax build, we can include its parser.
842+
if(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR)
843+
set(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS
844+
${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/cmake/SwiftSyntaxTargets.cmake)
845+
if(NOT EXISTS "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS}")
846+
message(STATUS "Skipping Swift Swift parser integration due to missing early SwiftSyntax")
847+
else()
848+
set(SWIFT_SWIFT_PARSER TRUE)
849+
include(${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS})
850+
851+
if(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
852+
# Only "HOSTTOOLS" is supported in Linux when Swift parser integration is enabled.
853+
message(WARNING "Force setting BOOTSTRAPPING=HOSTTOOLS because Swift parser integration is enabled")
854+
set(BOOTSTRAPPING_MODE "HOSTTOOLS")
855+
endif()
856+
endif()
857+
endif()
858+
841859
if(BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|.*-WITH-HOSTLIBS")
842860
if(SWIFT_ENABLE_ARRAY_COW_CHECKS)
843861
message(STATUS "array COW checks disabled when building the swift modules with host libraries")
@@ -944,24 +962,6 @@ if(XCODE)
944962
set(SWIFT_SDKS "OSX")
945963
endif()
946964

947-
# When we have the early SwiftSyntax build, we can include its parser.
948-
if(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR)
949-
set(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS
950-
${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/cmake/SwiftSyntaxTargets.cmake)
951-
if(NOT EXISTS "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS}")
952-
message(STATUS "Skipping Swift Swift parser integration due to missing early SwiftSyntax")
953-
else()
954-
set(SWIFT_SWIFT_PARSER TRUE)
955-
include(${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS})
956-
957-
if(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
958-
# Only "HOSTTOOLS" is supported in Linux when Swift parser integration is enabled.
959-
message(WARNING "Force setting BOOTSTRAPPING=HOSTTOOLS because Swift parser integration is enabled")
960-
set(BOOTSTRAPPING_MODE "HOSTTOOLS")
961-
endif()
962-
endif()
963-
endif()
964-
965965

966966
# FIXME: the parameters we specify in SWIFT_SDKS are lacking architecture specifics,
967967
# so we need to hard-code it. For example, the SDK for Android is just 'ANDROID',

0 commit comments

Comments
 (0)