[PATCH] D133482: [LLVM] Fix GetErrcMessages.cmake module for WoA

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 03:44:28 PDT 2022


DavidSpickett added a comment.

I was curious about the reasoning from cmake here.

https://cmake.org/cmake/help/latest/variable/CMAKE_TRY_COMPILE_CONFIGURATION.html#variable:CMAKE_TRY_COMPILE_CONFIGURATION:

  Projects built by try_compile() and try_run() are built synchronously during the CMake configuration step. Therefore a specific build configuration must be chosen even if the generated build system supports multiple configurations.

Which maybe implies that at the time they run cmake doesn't know what build type you want and goes to it's default which is debug (not the project's default, which may not be set yet). Though it does seem like a chicken and egg situation given that the way you set `CMAKE_TRY_COMPILE_CONFIGURATION` is itself in the project's cmake (or at least can be) but ok I'm missing something there I'm sure.

Is it possibly better to set this at a higher level? I know there is some existing logic to error if you don't choose a build type for llvm now, maybe there?

I think the overall idea of "you shouldn't need to be able to build debug if you chose to build release" is fine but there's probably more try_compiles.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133482



More information about the llvm-commits mailing list