Skip to content

build: fallback BOOTSTRAPPING_MODE before the first use #68527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,24 @@ elseif(BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS" OR SWIFT_SWIFT_PARSER)
set(SWIFT_EXEC_FOR_SWIFT_MODULES "${CMAKE_Swift_COMPILER}")
endif()

# When we have the early SwiftSyntax build, we can include its parser.
if(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR)
set(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS
${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/cmake/SwiftSyntaxTargets.cmake)
if(NOT EXISTS "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS}")
message(STATUS "Skipping Swift Swift parser integration due to missing early SwiftSyntax")
else()
set(SWIFT_SWIFT_PARSER TRUE)
include(${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS})

if(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
# Only "HOSTTOOLS" is supported in Linux when Swift parser integration is enabled.
message(WARNING "Force setting BOOTSTRAPPING=HOSTTOOLS because Swift parser integration is enabled")
set(BOOTSTRAPPING_MODE "HOSTTOOLS")
endif()
endif()
endif()

if(BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|.*-WITH-HOSTLIBS")
if(SWIFT_ENABLE_ARRAY_COW_CHECKS)
message(STATUS "array COW checks disabled when building the swift modules with host libraries")
Expand Down Expand Up @@ -944,24 +962,6 @@ if(XCODE)
set(SWIFT_SDKS "OSX")
endif()

# When we have the early SwiftSyntax build, we can include its parser.
if(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR)
set(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS
${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/cmake/SwiftSyntaxTargets.cmake)
if(NOT EXISTS "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS}")
message(STATUS "Skipping Swift Swift parser integration due to missing early SwiftSyntax")
else()
set(SWIFT_SWIFT_PARSER TRUE)
include(${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS})

if(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
# Only "HOSTTOOLS" is supported in Linux when Swift parser integration is enabled.
message(WARNING "Force setting BOOTSTRAPPING=HOSTTOOLS because Swift parser integration is enabled")
set(BOOTSTRAPPING_MODE "HOSTTOOLS")
endif()
endif()
endif()


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