From 72efd95add332161471c69a2f688f1ac459e4065 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 24 Feb 2021 10:06:26 -0800 Subject: PGI: Explicitly specify CMAKE_CXX98_STANDARD_COMPILE_OPTION The PGI ( and NVIDIA HPC ) compilers default C++ standard level are based on the GCC system headers it is compiling against. Therefore on newer platforms the default C++ level will be >= 11 and requesting C++98 compilation mode will fail as no explicit flag will be set. --- Modules/Compiler/PGI-CXX.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/Compiler/PGI-CXX.cmake b/Modules/Compiler/PGI-CXX.cmake index 3254353..1279c19 100644 --- a/Modules/Compiler/PGI-CXX.cmake +++ b/Modules/Compiler/PGI-CXX.cmake @@ -8,6 +8,8 @@ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10) set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --gnu_extensions) set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.10) + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION --c++03) + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --c++03 --gnu_extensions) set(CMAKE_CXX11_STANDARD_COMPILE_OPTION --c++11) set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION --c++11 --gnu_extensions) set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON) -- cgit v0.12