Starting from version 3.15, we can explicitly set the type of linking to the MSVC runtime library by setting the value CMAKE_MSVC_RUNTIME_LIBRARY.
Next, in 3.24, the CMAKE_WATCOM_RUNTIME_LIBRARY variable was introduced to provide a similar feature for Waston.
But unfortunately, we don’t have anything like this for libraries such as: libstdc++, libc++ and also C libraries.
In my opinion, CMake could have a variable whose value would pass the -static-libgcc -static-libstdc++
flags to the compiler with GNU frontend with suitable environment (and don’t forget about -shared-libgcc
-shared-libstdc++
for TDM-GCC). I should add that it would be useful with MSYS2 and Windows.
Q: If this is not planned, what are the objective reasons for the absence of the described feature?
This question seems obvious, but I have not found a similar discussion.