Skip to content

Commit da33e04

Browse files
committed
Copy over EarlySwiftDriver executables on Debug builds by specifyin the correct driver build directory
1 parent 1bee91b commit da33e04

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmake/modules/SwiftUtils.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,17 @@ endfunction()
191191
# to ensure that `swiftc` forwards to the standalone driver when invoked.
192192
function(swift_create_early_driver_copies target)
193193
# Early swift-driver is built adjacent to the compiler (swift build dir)
194-
set(driver_bin_dir "${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/release/bin")
194+
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
195+
set(driver_package_configuration_dir "release")
196+
else()
197+
set(driver_package_configuration_dir "debug")
198+
endif()
199+
200+
set(driver_bin_dir "${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/${driver_package_configuration_dir}/bin")
195201
set(swift_bin_dir "${SWIFT_RUNTIME_OUTPUT_INTDIR}")
196202
# If early swift-driver wasn't built, nothing to do here.
197203
if(NOT EXISTS "${driver_bin_dir}/swift-driver" OR NOT EXISTS "${driver_bin_dir}/swift-help")
198-
message(STATUS "Skipping creating early SwiftDriver symlinks - no early SwiftDriver build found.")
204+
message(STATUS "Skipping creating early SwiftDriver symlinks - no early SwiftDriver build found at: ${driver_bin_dir}.")
199205
return()
200206
endif()
201207

0 commit comments

Comments
 (0)