[PATCH] D134972: [CMake] Only set LLVM_DEFAULT_TARGET_TRIPLE to LLVM_HOST_TRIPLE when native target is enabled

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 13:28:32 PDT 2022


bogner added a comment.

FWIW this seems like a sensible change to me. The testing infrastructure for handling an empty triple is all there. It's sad that the clang tests don't pass, but that's a pre-existing issue with no default triple so I don't think it should block us here.

In D134972#3847120 <https://reviews.llvm.org/D134972#3847120>, @smeenai wrote:

> Conceptually, requiring the user to explicitly pick a default target triple from one of the backends they have enabled seems cleaner than having it be empty to me. We'd error out if you don't have the native target enabled and didn't explicitly specify LLVM_DEFAULT_TARGET_TRIPLE. Would that work for you?

I'm not necessarily opposed to some kind of warning here, but we would have to be careful not to error when the user explicitly sets an empty triple. This is fairly common when you want users of the compiler to have to choose a backend explicitly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134972



More information about the llvm-commits mailing list