[PATCH] D155431: [CMake] Clean up old code for handling MSVC runtime setting the old way

Yury Bura via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 03:10:13 PDT 2023


yurybura added a comment.

> I'm not able to reproduce this, when testing on latest git main and 17.0.1. Are you manually passing the `/D_DEBUG /MDd` options as cmake options somewhere? Have you done a properly clean reconfigure with cmake? Since the latest cmake policy setup, one is not supposed to pass those options manually anywhere, but just rely on setting `CMAKE_MSVC_RUNTIME_LIBRARY`, which does get hardcoded to `MultiThreaded` for the sanitizers.

Yes, the `/D_DEBUG /MDd` flags are defined manually. More precisely, I use VCPKG to build LLVM, and it declares them implicitly for debug configuration. LLVM and Clang themselves build with these flags, but the `compiler-rt` project fails (it is added as an external CMake project to the Clang build, and without fixing the code I don't know how to fix this failure). I think it's better to leave the CMake code to remove unsupported compiler flags. You can find the same code in other project. For example please refer `libcxx\CMakeLists.txt` :

  # FIXME: Remove all debug flags and flags that change which Windows
  # default libraries are linked. Currently we only support linking the
  # non-debug DLLs
  remove_flags("/D_DEBUG" "/MTd" "/MDd" "/MT" "/Md")


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155431



More information about the llvm-commits mailing list