-
Notifications
You must be signed in to change notification settings - Fork 16.1k
The "cmake/CMakeLists.txt -> CMakeLists.txt" redirection deactivates some policies silently. #12263
Copy link
Copy link
Closed
Labels
Description
The "cmake/CMakeLists.txt" is now deprecated, but there are some hidden problems with how it's forwarding to /CMakeLists.txt (in the repo root).
I found that some cmake policies get silently deactivated if one uses cmake/CMakeLists.txt
E.g. here:
Line 10 in 244b245
| if(POLICY CMP0091) |
Since CMP0091 needs to be set before languages are initialized, but
Line 5 in 244b245
| project(protobuf C CXX) |
and settings made here
Line 233 in 244b245
| if (protobuf_MSVC_STATIC_RUNTIME) |
/MD still being present in CMAKE_CXX_FLAGS_*
(at least this is my interpretation of what happens, but I've observed /MD flag being present when it should not).
Reactions are currently unavailable