diff options
author | Brad King <brad.king@kitware.com> | 2019-04-17 15:01:03 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-04-17 15:01:37 (GMT) |
commit | 2ed688a863671d58513055ad56ab04d6be05295b (patch) | |
tree | 91c01b78176bf39f6058fe3b9c1676dbb57cbcad /Help/prop_tgt | |
parent | 5cd187147ecbd29a0afc5a6b49f2232b61a1ab8c (diff) | |
parent | fb3370b6a1681190ffd8daf63975c44ce8fc1c49 (diff) | |
download | CMake-2ed688a863671d58513055ad56ab04d6be05295b.zip CMake-2ed688a863671d58513055ad56ab04d6be05295b.tar.gz CMake-2ed688a863671d58513055ad56ab04d6be05295b.tar.bz2 |
Merge topic 'msvc-runtime-library'
fb3370b6a1 MSVC: Add abstraction for runtime library selection
f621e7fa5d VS: Fix Fortran runtime library flag map special case for '-' options
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Leonid Pospelov <pospelovlm@yandex.ru>
Merge-request: !3211
Diffstat (limited to 'Help/prop_tgt')
-rw-r--r-- | Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt | 15 | ||||
-rw-r--r-- | Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst | 26 |
2 files changed, 41 insertions, 0 deletions
diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt new file mode 100644 index 0000000..2bf71a9 --- /dev/null +++ b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt @@ -0,0 +1,15 @@ +``MultiThreaded`` + Compile with ``-MT`` or equivalent flag(s) to use a multi-threaded + statically-linked runtime library. +``MultiThreadedDLL`` + Compile with ``-MD`` or equivalent flag(s) to use a multi-threaded + dynamically-linked runtime library. +``MultiThreadedDebug`` + Compile with ``-MTd`` or equivalent flag(s) to use a multi-threaded + statically-linked runtime library. +``MultiThreadedDebugDLL`` + Compile with ``-MDd`` or equivalent flag(s) to use a multi-threaded + dynamically-linked runtime library. + +The value is ignored on non-MSVC compilers but an unsupported value will +be rejected as an error when using a compiler targeting the MSVC ABI. diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst new file mode 100644 index 0000000..1e3f5e9 --- /dev/null +++ b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst @@ -0,0 +1,26 @@ +MSVC_RUNTIME_LIBRARY +-------------------- + +Select the MSVC runtime library for use by compilers targeting the MSVC ABI. + +The allowed values are: + +.. include:: MSVC_RUNTIME_LIBRARY-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_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") + +selects for the target ``foo`` a multi-threaded statically-linked runtime +library with or without debug information depending on the configuration. + +.. note:: + + This property has effect only when policy :policy:`CMP0091` 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. |