diff options
author | Brad King <brad.king@kitware.com> | 2018-03-14 18:04:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-14 18:07:00 (GMT) |
commit | 194b74daec04c46ab1ae3c5b18d51ae805a9dbe0 (patch) | |
tree | 7ac54240de71997d4d9a79fefb143c5769672c27 /Modules/CMakeCCompilerId.c.in | |
parent | c5541cf0da1093635fea7da5a40e64e481b5477e (diff) | |
download | CMake-194b74daec04c46ab1ae3c5b18d51ae805a9dbe0.zip CMake-194b74daec04c46ab1ae3c5b18d51ae805a9dbe0.tar.gz CMake-194b74daec04c46ab1ae3c5b18d51ae805a9dbe0.tar.bz2 |
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
Diffstat (limited to 'Modules/CMakeCCompilerId.c.in')
-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 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 |