MSVC_DEBUG_INFORMATION_FORMAT.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. MSVC_DEBUG_INFORMATION_FORMAT
  2. -----------------------------
  3. .. versionadded:: 3.25
  4. Select debug information format when targeting the MSVC ABI.
  5. The allowed values are:
  6. .. include:: MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
  7. Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
  8. support per-configuration specification. For example, the code:
  9. .. code-block:: cmake
  10. add_executable(foo foo.c)
  11. set_property(TARGET foo PROPERTY
  12. MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>")
  13. selects for the target ``foo`` the program database debug information format
  14. for the ``Debug`` and ``RelWithDebInfo`` configurations.
  15. This property is initialized from the value of the
  16. :variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable, if it is set.
  17. If this property is not set, CMake selects a debug information format using
  18. the default value ``$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>``, if
  19. supported by the compiler, and otherwise
  20. ``$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>``.
  21. .. note::
  22. This property has effect only when policy :policy:`CMP0141` is set to ``NEW``
  23. prior to the first :command:`project` or :command:`enable_language` command
  24. that enables a language using a compiler targeting the MSVC ABI.