With CMake 3.16.3 and 3.23.1 at least, when using CC=clang CXX=clang++ and doing a CMakeLists.txt like the following (simplified from the case in the WebKit code) I see a deprecation warning about .c files being treated as c++ when in c++ mode:
cmake_minimum_required(VERSION 3.13)
project(testproj)
add_executable(app app.c)
set_source_files_properties(app.c PROPERTIES LANGUAGE CXX)
and a simple app.c
int main() {}
The command being run seems to be
/usr/bin/clang++ -o CMakeFiles/app.dir/app.c.o -c /home/szabos1/cmtest/app.c
which gives
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
Using app.q rather than app.c, I got an error instead as it doesn’t generate an output file for ‘linker’ input.
I’m not sure if these sorts of cases where one overrides the language for a file is expected to work without the warning/errors.