This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Respect CMAKE_MSVC_RUNTIME_LIBRARY wrt whether to use the debug CRT
ClosedPublic

Authored by mstorsjo on Jul 18 2023, 1:02 AM.

Details

Summary

If CMAKE_MSVC_RUNTIME_LIBRARY isn't set, then CMake defaults to
the debug CRT, if CMAKE_BUILD_TYPE is set to Debug. If
CMAKE_MSVC_RUNTIME_LIBRARY is set though, that overrides any
implicit defaults.

Match this in libcxx's own manual linking logic. This allows
decoupling the debug CRT from the CMAKE_BUILD_TYPE and allows users
to configure their builds exactly how they want.

Diff Detail

Event Timeline

mstorsjo created this revision.Jul 18 2023, 1:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 1:02 AM
mstorsjo requested review of this revision.Jul 18 2023, 1:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 1:02 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

LGTM, except for the amount of duplication in these test configs, also mentioned on D155560.

andrewng accepted this revision.Jul 24 2023, 11:20 AM

On the basis that any de-duplication will happen separately.

Mordante accepted this revision.Jul 29 2023, 6:13 AM

I too would like to see less duplication. LGTM!

This revision is now accepted and ready to land.Jul 29 2023, 6:13 AM
mstorsjo updated this revision to Diff 546392.Aug 2 2023, 3:42 AM

Rebased to place this on top of the deduplication.

This revision was landed with ongoing or failed builds.Aug 4 2023, 5:55 AM
This revision was automatically updated to reflect the committed changes.