[PATCH] D155431: [CMake] Clean up old code for handling MSVC runtime setting the old way
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 28 06:09:50 PDT 2023
mstorsjo added a comment.
In D155431#4651673 <https://reviews.llvm.org/D155431#4651673>, @yurybura wrote:
> Once again, the default value for CMAKE_MSVC_RUNTIME_LIBRARY is `MultiThreaded$<$<CONFIG:Debug>:Debug>DLL` for the entire LLVM build, `/D_DEBUG` is added to CMAKE_CXX_FLAGS_DEBUG.
Are you saying that this gets added automatically by CMake in this variable, or that it is set manually by your build configuration? I don't think it's added automatically by CMake.
> The `compiler-rt` project overwrites CMAKE_MSVC_RUNTIME_LIBRARY, but does not change other compiler flags that conflict with the modified CRT version.
The point is that by switching `CMAKE_MSVC_RUNTIME_LIBRARY` to the right choice, debug/non-debug, the define `_DEBUG` gets added automatically by the compiler if building in a debug mode. You shouldn't be adding that manually.
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