diff --git a/Sources/TestingMacros/CMakeLists.txt b/Sources/TestingMacros/CMakeLists.txt index 97f06dd9c..048c16ffd 100644 --- a/Sources/TestingMacros/CMakeLists.txt +++ b/Sources/TestingMacros/CMakeLists.txt @@ -60,6 +60,11 @@ if(SwiftTesting_BuildMacrosAsExecutables) install(TARGETS TestingMacros RUNTIME DESTINATION bin) + if(MSVC) + install(FILES $/$.pdb + DESTINATION bin + OPTIONAL) + endif() else() add_library(TestingMacros SHARED) @@ -79,6 +84,11 @@ else() install(TARGETS TestingMacros LIBRARY DESTINATION "${plugin_destination_dir}" RUNTIME DESTINATION bin) + if(MSVC) + install(FILES $/$.pdb + DESTINATION bin + OPTIONAL) + endif() endif() target_sources(TestingMacros PRIVATE diff --git a/cmake/modules/SwiftModuleInstallation.cmake b/cmake/modules/SwiftModuleInstallation.cmake index 6947bb1cd..7a8159fa8 100644 --- a/cmake/modules/SwiftModuleInstallation.cmake +++ b/cmake/modules/SwiftModuleInstallation.cmake @@ -15,6 +15,11 @@ function(_swift_testing_install_target module) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) get_target_property(type ${module} TYPE) + if(MSVC AND NOT type STREQUAL STATIC_LIBRARY) + install(FILES $/$.pdb + DESTINATION ${CMAKE_INSTALL_BINDIR} + OPTIONAL) + endif() if(type STREQUAL EXECUTABLE) return() endif()