summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang-C.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-05-22 14:39:52 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2020-06-09 20:20:53 (GMT)
commit644d3b86ebb4be108172765e96251162e2537344 (patch)
tree88b4d602c6883f336b335c6fde8bdb8a562c35db /Modules/Compiler/Clang-C.cmake
parentc08ee5e74e4ee19989a99a405936a1cb61d33534 (diff)
downloadCMake-644d3b86ebb4be108172765e96251162e2537344.zip
CMake-644d3b86ebb4be108172765e96251162e2537344.tar.gz
CMake-644d3b86ebb4be108172765e96251162e2537344.tar.bz2
C: Compile when possible with explicit `C` language flag set
Issue: #14516, #20716
Diffstat (limited to 'Modules/Compiler/Clang-C.cmake')
-rw-r--r--Modules/Compiler/Clang-C.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index 7c4a263..fb6ffa7 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -8,6 +8,8 @@ endif()
if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
+elseif("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)