summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2021-02-24 18:06:26 (GMT)
committerRobert Maynard <rmaynard@nvidia.com>2021-02-24 18:47:03 (GMT)
commit72efd95add332161471c69a2f688f1ac459e4065 (patch)
treee72f1c42531ff259a49afbcd9bb7c685b669a717 /Modules/Compiler
parent6bfb2c6175e698df8d0e0bad5e4733f3f842d67f (diff)
downloadCMake-72efd95add332161471c69a2f688f1ac459e4065.zip
CMake-72efd95add332161471c69a2f688f1ac459e4065.tar.gz
CMake-72efd95add332161471c69a2f688f1ac459e4065.tar.bz2
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.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/PGI-CXX.cmake2
1 files changed, 2 insertions, 0 deletions
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)