From 194b74daec04c46ab1ae3c5b18d51ae805a9dbe0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 14 Mar 2018 14:04:12 -0400 Subject: XL: Fix C default level detection when invoked as 'cc' The IBM XL C compiler does not define `__STDC__` when invoked as plain `cc` instead of `xlc`, so `CMAKE_C_STANDARD_COMPUTED_DEFAULT` does not get set and CMake fails. Teach CMake about the XL compiler's default C standard in this case. Fixes: #17649 --- Modules/CMakeCCompilerId.c.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 10f7318..2f6bdb4 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -34,7 +34,8 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; @CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@ #if !defined(__STDC__) -# if defined(_MSC_VER) && !defined(__clang__) +# if (defined(_MSC_VER) && !defined(__clang__)) \ + || (defined(__ibmxl__) || defined(__IBMC__)) # define C_DIALECT "90" # else # define C_DIALECT -- cgit v0.12