Skip to content

Copy over EarlySwiftDriver executables on Debug builds by specifying the correct driver build directory #73893

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 28, 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
10 changes: 8 additions & 2 deletions cmake/modules/SwiftUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,17 @@ endfunction()
# to ensure that `swiftc` forwards to the standalone driver when invoked.
function(swift_create_early_driver_copies target)
# Early swift-driver is built adjacent to the compiler (swift build dir)
set(driver_bin_dir "${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/release/bin")
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(driver_package_configuration_dir "release")
else()
set(driver_package_configuration_dir "debug")
endif()

set(driver_bin_dir "${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/${driver_package_configuration_dir}/bin")
set(swift_bin_dir "${SWIFT_RUNTIME_OUTPUT_INTDIR}")
# If early swift-driver wasn't built, nothing to do here.
if(NOT EXISTS "${driver_bin_dir}/swift-driver" OR NOT EXISTS "${driver_bin_dir}/swift-help")
message(STATUS "Skipping creating early SwiftDriver symlinks - no early SwiftDriver build found.")
message(STATUS "Skipping creating early SwiftDriver symlinks - no early SwiftDriver build found at: ${driver_bin_dir}.")
return()
endif()

Expand Down