You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
matejk
changed the title
Windows Static Build Porblem / Changed behaviour of POCO_MT
Windows Static Build Problem / Changed behaviour of POCO_MT (CMake 3.15)
Dec 12, 2024
…IME_LIBRARY (fixes#4817) (#4823)
* fix(CMake): Select MSVC runtime library with variable CMAKE_MSVC_RUNTIME_LIBRARY instead of modifying compiler flags.
* enh(CI): Add static and MT MSVC builds.
* fix(CMake): Correct TestLibrary DLL name when building with MSVC
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:
The text was updated successfully, but these errors were encountered: