From 590553f32246b374853c50cf7c30af3880ac02ea Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Mon, 7 Jun 2021 18:18:29 +0000 Subject: Compilers: protect use of __has_include If the compiler does not have __has_include, pretend the answer is always no --- Modules/CMakeCXXCompilerId.cpp.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Modules/CMakeCXXCompilerId.cpp.in') diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index a67caba2c3..7362a08374 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -5,6 +5,12 @@ # error "A C compiler has been selected for C++." #endif +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + @CMAKE_CXX_COMPILER_ID_CONTENT@ /* Construct the string literal in pieces to prevent the source from -- cgit v1.2.1