Skip to content

build: improve debug builds on Windows #24897

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 20, 2019
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
14 changes: 14 additions & 0 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1914,6 +1914,20 @@ function(add_swift_target_library name)
GYB_SOURCES ${SWIFTLIB_GYB_SOURCES}
)

if(sdk STREQUAL WINDOWS)
if(SWIFT_COMPILER_IS_MSVC_LIKE)
if (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreadedDebugDLL)
target_compile_options(${VARIANT_NAME} PRIVATE /MDd /D_DLL /D_DEBUG)
elseif (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreadedDebug)
target_compile_options(${VARIANT_NAME} PRIVATE /MTd /U_DLL /D_DEBUG)
elseif (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreadedDLL)
target_compile_options(${VARIANT_NAME} PRIVATE /MD /D_DLL /U_DEBUG)
elseif (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreaded)
target_compile_options(${VARIANT_NAME} PRIVATE /MT /U_DLL /U_DEBUG)
endif()
endif()
endif()

if(NOT SWIFTLIB_OBJECT_LIBRARY)
# Add dependencies on the (not-yet-created) custom lipo target.
foreach(DEP ${SWIFTLIB_LINK_LIBRARIES})
Expand Down