[Libwebsockets] VS2019 static generation
normandviking at gmail.com
Thu Feb 18 20:19:27 CET 2021
I am recompiling the latest lib v4.0-stable from git, and I am executing
these 2 commands to compile it:
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=RELEASE
-DLWS_WITH_MINIMAL_EXAMPLES=0 -DLWS_WITH_SHARED=OFF -DLWS_STATIC_PIC=1
-DCMAKE_INSTALL_PREFIX:PATH=c:/3rdparty/libwebsockets -G "Visual Studio 10"
cmake --build . --target install --config Release
The build succeeds but the files are compiled with the /MD flag even if the
static option is specified.
My goal is to get a static library compiled with the /MT flag instead of
the /MD as I am having linking CRT issues when linking with some other
I spent some time trying with cmake options with no luck.
Then hacking the cmake file but that's not really usable down the line.
In despair, I found that lws also generate Visual studio projects. I loaded
them successfully and manually set the option in Release to use /MT and
Then the link with my other program worked nicely.
So my question is, is there a supported option to use different CRT?
It would be great if we could use a CMake option to set up which one to use
like for example:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libwebsockets