Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Help / variable / CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst
1 CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
2 -----------------------------------
3
4 .. versionadded:: 3.25
5
6 Select the MSVC debug information format targeting the MSVC ABI.
7 This variable is used to initialize the
8 :prop_tgt:`MSVC_DEBUG_INFORMATION_FORMAT` property on all targets as they are
9 created.  It is also propagated by calls to the :command:`try_compile` command
10 into the test project.
11
12 The allowed values are:
13
14 .. include:: ../prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
15
16 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
17 support per-configuration specification.  For example, the code:
18
19 .. code-block:: cmake
20
21   set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>")
22
23 selects for all following targets the program database debug information format
24 for the Debug configuration.
25
26 If this variable is not set, the :prop_tgt:`MSVC_DEBUG_INFORMATION_FORMAT`
27 target property will not be set automatically.  If that property is not set,
28 CMake selects a debug information format using the default value
29 ``$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>``, if supported by the
30 compiler, and otherwise ``$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>``.
31
32 .. note::
33
34   This variable has effect only when policy :policy:`CMP0141` is set to ``NEW``
35   prior to the first :command:`project` or :command:`enable_language` command
36   that enables a language using a compiler targeting the MSVC ABI.