diff options
author | Brad King <brad.king@kitware.com> | 2018-03-14 14:04:12 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-14 14:07:00 -0400 |
commit | 194b74daec04c46ab1ae3c5b18d51ae805a9dbe0 (patch) | |
tree | 7ac54240de71997d4d9a79fefb143c5769672c27 | |
parent | c5541cf0da1093635fea7da5a40e64e481b5477e (diff) | |
download | cmake-194b74daec04c46ab1ae3c5b18d51ae805a9dbe0.tar.gz |
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
-rw-r--r-- | Modules/CMakeCCompilerId.c.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 10f7318a68..2f6bdb4a78 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 |