Add option to disable use of static runtime#19
Conversation
|
I merged the request so it exists as a commit one can reference, but in my tests, the pre-existing code to achieve a static runtime did not work, I think because CMake puts the compiler flags into the cache, so even when you change the flags, it has no effect. I think this used to work, but I'm not sure how. Perhaps it does work if you clear the cache. What I'm seeing now is that the new option has no effect. I see now that CMake has a new mechanism for MSVC linker flags and the flags used in PortMidi are both deprecated and used by default (!) in the latest CMake versions. I'm going to replace all this with target options and make it work as intended, including the PM_USE_STATIC_RUNTIME option. To answer a question I saw in my email, but not sure where it was posted, yes I think it's a mistake to combine static linking with a DLL runtime -- if you want to make a binary that is free of dependencies and can run on another machine without including and installing additional DLLs, you should link the runtime statically, because "the CRT DLL is no longer considered a system file." Microsoft suggests you should install a separate copy of the CRT DLL for every application. That seems to be the approach advocated by CMake and MSVC, but it seems simpler to just use a static version of the CRT. |
With this pull request a new option is added PM_USE_STATIC_RUNTIME that allows disabling the use of the static runtime.
PM_USE_STATIC_RUNTIME defaults to ON