[PATCH] D71570: [CMake] Prefer multi-target variables over generic target variables in runtimes build

James Nagurne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 20 13:25:57 PST 2019


JamesNagurne added a comment.

In D71570#1792087 <https://reviews.llvm.org/D71570#1792087>, @phosek wrote:

> I'm fine with this change in general, but I'm concerned that no matter what order we choose, this might break users who rely on the opposite order.  Maybe it'd be better to modify the logic to skip the second loop if the first loop matches, that way we wouldn't rely on any particular order.


I think the problem is the behavior wasn't defined at all before, and relied on how cmake defined the variables in the LLVM project cmake cache file.

What I wrote in my runtimes cache file:

- RUNTIMES_target_VARIABLE=123
- RUNTIMES_target+multi_VARIABLE=456

What I got in LLVM's CMakeCache.txt

- RUNTIMES_target+multi_VARIABLE=456
- RUNTIMES_target=VARIABLE=123

What I expected in CMakeCache.txt:

- RUNTIMES_target=VARIABLE=123
- RUNTIMES_target+multi_VARIABLE=456

The result: VARIABLE in the target+multi runtime project was 123 instead of 456

While we might break projects, I believe that this solves the problem of relying on some internal cmake or system behavior (I don't know why the resulting CMakeCache.txt is out-of-order, haven't dug that deep), while allowing users to get whatever behavior they want.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71570





More information about the llvm-commits mailing list