Merge topic 'nvhpc_support_new_c_and_c++_standards'

9ac426e460 NVHPC-C: Add support for C17
f5dbc27c27 NVHPC-CXX: Add support for C++20

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !6430
This commit is contained in:
Brad King
2021-08-09 13:36:40 +00:00
committed by Kitware Robot
2 changed files with 10 additions and 0 deletions

View File

@@ -4,4 +4,9 @@ include(Compiler/NVHPC)
# Needed so that we support `LANGUAGE` property correctly
set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11)
set(CMAKE_C17_STANDARD_COMPILE_OPTION -std=c17)
set(CMAKE_C17_EXTENSION_COMPILE_OPTION -std=gnu17)
endif()
__compiler_nvhpc(C)

View File

@@ -4,4 +4,9 @@ include(Compiler/NVHPC)
# Needed so that we support `LANGUAGE` property correctly
set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION -std=c++20)
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION -std=gnu++20)
endif()
__compiler_nvhpc(CXX)