CMP0203.rst 1.2 KB

12345678910111213141516171819202122232425262728
  1. CMP0203
  2. -------
  3. .. versionadded:: 4.2
  4. ``_WINDLL`` is defined for shared libraries targeting the MSVC ABI.
  5. In CMake 4.1 and below, :ref:`Visual Studio Generators` compile sources in
  6. shared libraries with ``_WINDLL`` defined due to behavior of Visual Studio
  7. itself. The preprocessor definition is not modeled by CMake and is therefore
  8. not added by other generators, such as :generator:`Ninja`.
  9. CMake 4.2 and above, when targeting the MSVC ABI, prefer to compile sources
  10. in shared libraries with ``_WINDLL`` defined by all generators.
  11. This policy provides compatibility with projects that have not been updated
  12. to be aware of the definition. Its setting is recorded by each target as
  13. it is created, and affects compilation of sources in that target.
  14. The ``OLD`` behavior for this policy does not model the ``_WINDLL``
  15. preprocessor definition in CMake itself. The ``NEW`` behavior for this
  16. policy adds the ``_WINDLL`` preprocessor definition to sources in shared
  17. libraries when targeting the MSVC ABI.
  18. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.2
  19. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  20. .. include:: include/STANDARD_ADVICE.rst
  21. .. include:: include/DEPRECATED.rst