mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-27 09:29:15 -05:00
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
This commit is contained in:
@@ -34,7 +34,8 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
|||||||
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
|
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
|
||||||
|
|
||||||
#if !defined(__STDC__)
|
#if !defined(__STDC__)
|
||||||
# if defined(_MSC_VER) && !defined(__clang__)
|
# if (defined(_MSC_VER) && !defined(__clang__)) \
|
||||||
|
|| (defined(__ibmxl__) || defined(__IBMC__))
|
||||||
# define C_DIALECT "90"
|
# define C_DIALECT "90"
|
||||||
# else
|
# else
|
||||||
# define C_DIALECT
|
# define C_DIALECT
|
||||||
|
|||||||
Reference in New Issue
Block a user