diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2021-06-07 18:18:29 +0000 |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2021-06-07 19:25:09 +0000 |
commit | 590553f32246b374853c50cf7c30af3880ac02ea (patch) | |
tree | b3ebca5035eb33d2df0997e99b5357cfcf3dd042 /Modules/CMakeCXXCompilerId.cpp.in | |
parent | ed3aad97e3d3cb27637722fabb0ae3a5611daf5c (diff) | |
download | cmake-590553f32246b374853c50cf7c30af3880ac02ea.tar.gz |
Compilers: protect use of __has_include
If the compiler does not have __has_include, pretend the answer is always no
Diffstat (limited to 'Modules/CMakeCXXCompilerId.cpp.in')
-rw-r--r-- | Modules/CMakeCXXCompilerId.cpp.in | 6 |
1 files changed, 6 insertions, 0 deletions
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 |