-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Describe the bug
I Build Poco on Windows.
After Updating from 1.13.3 to 1.14.0 I got linking issues complaining about Runtime Library. Basically me Building statically linking to non statically poco.
I use BUILD_SHARED_LIBS=OFF and POCO_MT=ON
I noticed in the Poco build Output the CXX flags /MT were gone after updating to 1.14.0
I investigated the issue and came up with the following:
In poco/CMakeLists.txt
cmake_minimum_required(VERSION 3.5.0) was updated to cmake_minimum_required(VERSION 3.15.0)
This leads to changed policy: https://cmake.org/cmake/help/latest/policy/CMP0091.html
This will change the default CXX flags to NOT include /MD.
POCO_MT Variable relies on on having /MD flag and than replacing them with /MT in poco/cmake/DefinePlatformSpecific.cmake
Since /MD is not there, it won't replace it and it won't change to static.
I added -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug to my cmake command, which probably is the intended way of setting static now.
To Reproduce
Build Poco with BUILD_SHARED_LIBS=OFF and POCO_MT=ON and then using it in a statically linked cmake project in Visual Studio. (That's how I ran into the problem.)
Expected behavior
Poco should build static or docs should be updated.
Please add relevant environment information:
- Windows 11
- Poco 1.14.0
- Visual Studio 17.12.1
Metadata
Metadata
Assignees
Labels
Type
Projects
Status