mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00

Revert commit 74b1c9fc8e
(Explicitly specify language flag when source
LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2) and the lookup
tables from its two immediate ancestors. The purpose of that change was
to convert an explicit `LANGUAGE` source file property into an explicit
language specification compiler flag like `-x c`. This seems reasonable
since the property is documented as meaning "indicate what programming
language the source file is". It is also needed to help compilers deal
with non-standard source file extensions they don't recognize.
However, some projects have been setting `LANGUAGE C` on `.S` assembler
source files to mean "use the C compiler". Passing `-x c` for them
breaks the build because the `.S` sources are not written in C. These
projects should be updated to use `enable_language(ASM)`, for which
CMake often chooses the C compiler as the assembler when using
toolchains that support it (which would have to be the case for projects
using the approach).
Revert the change for now to preserve the old behavior for such projects.
We can re-introduce it with a policy in a future version of CMake.
Fixes: #21469
Issue: #14516, #20716
CMake Tests Directory ********************* This directory contains the CMake test suite. See also the `CMake Source Code Guide`_. .. _`CMake Source Code Guide`: ../Help/dev/source.rst Many tests exist as immediate subdirectories, but some tests are organized as follows. * ``CMakeLib/``: Source code, used for tests, that links to the ``CMakeLib`` library defined over in ``Source/``. * ``CMakeOnly/``: Deprecated. Tests that run CMake to generate a project but not build it. Superseded by ``Tests/RunCMake/``. * ``Find*/``: Tests for specific find modules that can only be run on machines with the corresponding packages installed. They are enabled in ``CMakeLists.txt`` by undocumented options used on CI builds. * ``Module/``: Tests for specific CMake modules. * ``RunCMake/``: Tests that run CMake and/or other tools while precisely checking their return code and stdout/stderr content. Useful for testing error cases and diagnostic output.