Skip to content

[cmake] Only check HostCompatibilityLibs for bootstrapping builds #73383

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
merged 1 commit into from
May 3, 2024
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
24 changes: 14 additions & 10 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -467,16 +467,20 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)

set(sdk_dir "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}/usr/lib/swift")

# HostCompatibilityLibs is defined as an interface library that
# does not generate any concrete build target
# (https://cmake.org/cmake/help/latest/command/add_library.html#interface-libraries)
# In order to specify a dependency to it using `add_dependencies`
# we need to manually "expand" its underlying targets
get_property(compatibility_libs
TARGET HostCompatibilityLibs
PROPERTY INTERFACE_LINK_LIBRARIES)
set(compatibility_libs_path
"${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH}")
# Note we only check this for bootstrapping, since you ought to
# be able to build using hosttools with the stdlib disabled.
if(ASRLF_BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")
# HostCompatibilityLibs is defined as an interface library that
# does not generate any concrete build target
# (https://cmake.org/cmake/help/latest/command/add_library.html#interface-libraries)
# In order to specify a dependency to it using `add_dependencies`
# we need to manually "expand" its underlying targets
get_property(compatibility_libs
TARGET HostCompatibilityLibs
PROPERTY INTERFACE_LINK_LIBRARIES)
set(compatibility_libs_path
"${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH}")
endif()

# If we found a swift compiler and are going to use swift code in swift
# host side tools but link with clang, add the appropriate -L paths so we
Expand Down