9b978b28d53d8f6b06263958dd5cb9f9cda38950
[platform/upstream/cmake.git] / Help / prop_tgt / MSVC_RUNTIME_LIBRARY.rst
1 MSVC_RUNTIME_LIBRARY
2 --------------------
3
4 .. versionadded:: 3.15
5
6 Select the MSVC runtime library for use by compilers targeting the MSVC ABI.
7
8 The allowed values are:
9
10 .. include:: MSVC_RUNTIME_LIBRARY-VALUES.txt
11
12 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
13 support per-configuration specification.  For example, the code:
14
15 .. code-block:: cmake
16
17   add_executable(foo foo.c)
18   set_property(TARGET foo PROPERTY
19     MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
20
21 selects for the target ``foo`` a multi-threaded statically-linked runtime
22 library with or without debug information depending on the configuration.
23
24 If this property is not set then CMake uses the default value
25 ``MultiThreaded$<$<CONFIG:Debug>:Debug>DLL`` to select a MSVC runtime library.
26
27 .. note::
28
29   This property has effect only when policy :policy:`CMP0091` is set to ``NEW``
30   prior to the first :command:`project` or :command:`enable_language` command
31   that enables a language using a compiler targeting the MSVC ABI.