summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-27 14:00:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-11-27 14:00:44 (GMT)
commit1882ba2e0506deeb06f334b7459921286238d719 (patch)
tree3ac503b319e019545d4e08cbfa131b967d00bd1b /Help
parentb67762ff3c4e24be75090cb2dca6c2b0e7f08dcb (diff)
parent2ae880fa8f04a2026939b1df9613b64a301aa522 (diff)
downloadCMake-1882ba2e0506deeb06f334b7459921286238d719.zip
CMake-1882ba2e0506deeb06f334b7459921286238d719.tar.gz
CMake-1882ba2e0506deeb06f334b7459921286238d719.tar.bz2
Merge topic 'extend-compile-language-genex'
2ae880fa Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio 2b7d59f3 Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual Studio 0f6f7c8a Genex: Fix COMPILE_LANGUAGE messages to allow file(GENERATE) with Xcode c5a82d0f Tests: Decouple COMPILE_LANGUAGE in file(GENERATE) from COMPILE_OPTIONS 25773650 Tests: Remove unnecessary result files from RunCMake.File_Generate Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Jason Juang <jasjuang@gmail.com> Merge-request: !1511
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst12
-rw-r--r--Help/release/dev/extend-compile-language-genex.rst7
2 files changed, 14 insertions, 5 deletions
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index bddb174..dc5621a 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -97,7 +97,7 @@ Available logical expressions are:
compile features and a list of supported compilers.
``$<COMPILE_LANGUAGE:lang>``
``1`` when the language used for compilation unit matches ``lang``,
- otherwise ``0``. This expression used to specify compile options for
+ otherwise ``0``. This expression may be used to specify compile options for
source files of a particular language in a target. For example, to specify
the use of the ``-fno-exceptions`` compile option (compiler id checks
elided):
@@ -109,10 +109,12 @@ Available logical expressions are:
PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
)
- This generator expression has limited use because it is not possible to
- use it with the Visual Studio generators. Portable buildsystems would
- not use this expression, and would create separate libraries for each
- source file language instead:
+ Note that with :ref:`Visual Studio Generators` there is no way to represent
+ target-wide flags separately for ``C`` and ``CXX`` languages. Under these
+ generators, target-wide flags for both C and C++ sources will be evaluated
+ using ``CXX`` if there are any C++ sources and otherwise using ``C``.
+ A workaround is to create separate libraries for each source file language
+ instead:
.. code-block:: cmake
diff --git a/Help/release/dev/extend-compile-language-genex.rst b/Help/release/dev/extend-compile-language-genex.rst
new file mode 100644
index 0000000..0a0a669
--- /dev/null
+++ b/Help/release/dev/extend-compile-language-genex.rst
@@ -0,0 +1,7 @@
+extend-compile-language-genex
+-----------------------------
+
+* The ``COMPILE_LANGUAGE`` :manual:`generator expression
+ <cmake-generator-expressions(7)>` may now be used with
+ :ref:`Visual Studio Generators` in :prop_tgt:`COMPILE_OPTIONS`
+ and :command:`file(GENERATE)`.