[PATCH] D142405: [CMake] Replace list(FIND) by if(IN_LIST) where index isn't used

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 23:51:53 PST 2023


phosek added a comment.

In D142405#4081563 <https://reviews.llvm.org/D142405#4081563>, @beanz wrote:

> In D142405#4081473 <https://reviews.llvm.org/D142405#4081473>, @aaronpuchert wrote:
>
>> This doesn't affect us internally because we have `cmake_minimum_required(VERSION 3.13.4)`, but should we add `cmake_policy(SET CMP0057 NEW)` to the exported files? Perhaps in a `PUSH`/`POP`?
>
> IMO, this is a problem for the downstream project.
>
> We require CMake 3.13.4 for building LLVM which allows us to use CMake 3.13 features in our CMake modules. Any project using LLVM’s CMake modules _should_ have the same requirement. If we were going to do anything to address this, the approach I would take would be to make importing the LLVM CMake modules a fatal error if `CMAKE_MINIMUM_REQUIRED_VERSION` is less than 3.13.4.
>
> Supporting some parts of LLVM’s CMake on older required versions is not going to be trivial, and I don’t think we should do it.
>
> Not sure if @phosek, @smeenai, @compnerd, or @ldionne have different thoughts.

I agree, supporting older CMake versions has never been our goal, the fact that it works today is just a coincidence. I also support including an explicit version check in exported files.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142405



More information about the llvm-commits mailing list