CMake/Tests/CMakeCommands
Brad King 2ae880fa8f Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio
Since commit v3.9.0-rc4~3^2~1 (VS: Fix target_compile_options for CUDA,
2017-06-21), the evaluation of `COMPILE_LANGUAGE` receives the proper
language.  The set of compile flags used for a target's C and C++
sources is based on the linker language.  By default this is always the
C++ flags if any C++ sources appear in the target, and otherwise the C
flags.  Therefore we can define the `COMPILE_LANGUAGE` generator
expression in `COMPILE_OPTIONS` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
can do.  It is also sufficient for many use cases since the set of
allowed flags for C and C++ is almost the same in Visual Studio.
Furthermore, since the VS generator moves many of the flags to
declarative `.vcxproj` elements, it will automatically avoid passing
C++ flags for C sources.

Issue: #17435
2017-11-20 13:51:25 -05:00
..
add_compile_options Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
target_compile_definitions Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
target_compile_features CompileFeatures: Makes tests work with meta-feature only 2017-05-29 13:51:45 -04:00
target_compile_options Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio 2017-11-20 13:51:25 -05:00
target_include_directories Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
target_link_libraries Tests: Ensure Solaris linker never sees empty contents 2017-05-18 10:32:03 +10:00