[PATCH] D151613: Do not set CMAKE_CXX_FLAGS_<config> with FORCE

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 06:35:48 PDT 2023


beanz added a comment.

In D151613#4603055 <https://reviews.llvm.org/D151613#4603055>, @ArtemSkrebkov wrote:

> FORCE setting is in place after https://reviews.llvm.org/D155233 , so I guess it still should be the case.
>
> But let me check to be sure.

The problem isn’t actually with the `FORCE` flag. The problem you were seeing was caused by CMake and LLVM’s configure scripts each having its own way of setting those flags. When these scripts were first written CMake didn’t have an official way to set those flags. LLVM adopts new CMake behaviors fairly slowly to maintain support for older versions of CMake.

The code today removes the `-M*` options from the C and CXX flags variables and relies on setting the `CMAKE_MSVC_RUNTIME_LIBRARY` variable instead. @mstorsjo could speak more about the need for it to be `FORCE`d, but my guess is that since that is a CMake option, a default value for it gets set, and _only_ when translating the LLVM option to the CMake option we need to `FORCE` overwriting the value. So if you don’t pass `LLVM_USE_CRT_*`, the `FORCE` line shouldn’t get hit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151613



More information about the llvm-commits mailing list