summaryrefslogtreecommitdiffstats
path: root/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
diff options
context:
space:
mode:
authorGlen Chung <kuchung@microsoft.com>2022-08-25 16:37:12 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-14 13:12:47 (GMT)
commit0e96a20478948c18a677b129c2a1de31261bbcb0 (patch)
tree6d4095c2b84b090fdcddb0dfbd384799827e8d8d /Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
parentd4c8111da42371d2e7c0501f032db374b289a148 (diff)
downloadCMake-0e96a20478948c18a677b129c2a1de31261bbcb0.zip
CMake-0e96a20478948c18a677b129c2a1de31261bbcb0.tar.gz
CMake-0e96a20478948c18a677b129c2a1de31261bbcb0.tar.bz2
MSVC: Add abstraction for debug information format
Replace our hard-coded default for `/Zi` with a first-class abstraction to select the debug information format an enumeration of logical names. We've long hesitated to do this because the idea of "debug information format" touches on related concepts on several platforms. Avoid that scope creep by simply defining an abstraction that applies only when targeting the MSVC ABI on Windows. Removing the old default flag requires a policy because existing projects may rely on string processing to edit them and choose a runtime library under the old behavior. Add policy CMP0141 to provide compatibility. Fixes: #10189
Diffstat (limited to 'Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst')
-rw-r--r--Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst33
1 files changed, 33 insertions, 0 deletions
diff --git a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
new file mode 100644
index 0000000..2314cff
--- /dev/null
+++ b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
@@ -0,0 +1,33 @@
+MSVC_DEBUG_INFORMATION_FORMAT
+-----------------------------
+
+.. versionadded:: 3.25
+
+Select debug information format targeting the MSVC ABI.
+
+The allowed values are:
+
+.. include:: MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
+support per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+ add_executable(foo foo.c)
+ set_property(TARGET foo PROPERTY
+ MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>")
+
+selects for the target ``foo`` the program database debug information format
+for the Debug configuration.
+
+If this property is not set, CMake selects a debug information format using
+the default value ``$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>``, if
+supported by the compiler, and otherwise
+``$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>``.
+
+.. note::
+
+ This property has effect only when policy :policy:`CMP0141` is set to ``NEW``
+ prior to the first :command:`project` or :command:`enable_language` command
+ that enables a language using a compiler targeting the MSVC ABI.