mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-17 07:11:52 +08:00

Since commit 3b547e2e4b
(VS: Simplify logic adding source file C/C++
language flag to MSVC, 2020-05-15, v3.18.0-rc1~139^2~1) we only add a
per-source language selection flag when the source file extension does
not match the compiler's default. This approach breaks when a project
adds a target-wide `-TP` flag.
Although such projects likely did not work with non-VS generators, we
did support them before in Visual Studio generators. Add a special case
to tolerate such flags again.
Fixes: #21005
9 lines
106 B
C
9 lines
106 B
C
#ifdef __cplusplus
|
|
# error C source incorrectly compiled as C++
|
|
#endif
|
|
|
|
int stay_c(void)
|
|
{
|
|
return 0;
|
|
}
|