-
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove MSVC warning D9025 overriding '/MD' with '/MT'
#443
Comments
I think that for CMake you should use https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html to set it to match what llvm gives. |
Hello @jcelerier, thanks! How do I use these generator expressions? Like that:
Setting both properties and Andreas |
The flags are
so
will evaluate to MultiThreadedDebug if CMAKE_BUILD_TYPE=Debug and MultiThreaded in all the other cases. But I think that you should just set it to whatever llvm-config gives you because it's the one which is imposing it (you need to link with a CMAKE_BUILD_TYPE=Debug llvm if your own app is on debug mode and a CMAKE_BUILD_TYPE=Release llvm on release mode because the ABI of std:: and of some LLVM types do change anyways) |
(my personal solution to sidestep this madness is to not use MSVC at all but Clang+libc++ on Windows which does not have these issues - a debug libc++ can be used by programs built in Release and conversely) |
Thanks! C++ Insights uses both, Clang+libc++ on Windows and cl.exe + libc++. Mainly to get all errors and warnings and ensure that this setup works as well. I see how to approach this. Thank you for your support! |
Fixed #443: Using the correct config to remove MSVC warning D9025.
The Windows builds using
cl.exe
, for example "MSVC 2022 / LLVM 13 @ Windows Release" produce the warningD9025
:The full output can be found here github.com/andreasfertig/cppinsights/runs/5076959142
The values
MT
,EHs-
, ... are obtained fromllvm-config
github.com/andreasfertig/cppinsights/runs/5076959142:It looks likes
cmake
sets some kind of default (MD
) which is not correctly overridden.The values from
llvm_config
should be used for the build, other defaults should be removed.Andreas
The text was updated successfully, but these errors were encountered: