[PATCH] D150688: [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 04:31:36 PDT 2023


mstorsjo added a comment.

In D150688#4349022 <https://reviews.llvm.org/D150688#4349022>, @hans wrote:

>> Tangentially; for libc++ builds, `ChooseMSVCCRT.cmake` isn't ever included and used so far. So for the sake of libc++ at the moment, I'd go with keeping `CMP0091` set to the new behaviour - which probably is the more convenient way of interacting with the choice of CRT going forward.
>>
>> I do see that `CMakePolicy.cmake` doesn't get included in libc++ builds either, so I think that should all be fine.
>
> Does libc++ do anything else to choose crt?

Actually, I was mistaken, `ChooseMSVCCRT.cmake` does get included there too. However only the default of `/MD` is supported anyway, at the moment.

> compiler-rt has seems to have its own thing in https://github.com/llvm/llvm-project/blob/llvmorg-16.0.3/compiler-rt/CMakeLists.txt#L398

Oh, I see. This seems to look for the literal form `/MD`, but after the CMake update, CMake seems to set the option in the form `-MD`, so if this pattern is updated to check for both `/` and `-`, this might start working as expected.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150688/new/

https://reviews.llvm.org/D150688



More information about the llvm-commits mailing list