From 4de28ba4e6348f99de57bd2961b00dcd4cda213b Mon Sep 17 00:00:00 2001 From: Tin Huynh Date: Wed, 27 Jan 2021 00:00:58 -0800 Subject: Tests: Update tests for NVHPC compiler Treat it just like PGI. --- Tests/CompileFeatures/CMakeLists.txt | 4 ++-- Tests/FortranOnly/CMakeLists.txt | 2 +- Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 4 ++-- Tests/RunCMake/CMakeLists.txt | 2 +- Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 0838532..922e07f 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -15,7 +15,7 @@ macro(run_test feature lang) endif() endmacro() -if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") +if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang)$") get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) list(FILTER c_features EXCLUDE REGEX "^c_std_[0-9][0-9]") foreach(feature ${c_features}) @@ -23,7 +23,7 @@ if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") endforeach() endif() -if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") +if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang)$") get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) list(FILTER cxx_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]") foreach(feature ${cxx_features}) diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index 637f581..b40f05e 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -146,7 +146,7 @@ set_property(SOURCE no_preprocess_source_lower.f PROPERTY Fortran_PREPROCESS OFF # Test that we can explicitly not preprocess a target or source. # This will not work on certain compilers due to either missing a # "don't preprocess" flag, or due to choice of file extension. -if(test_pp_flags AND NOT CMAKE_Fortran_COMPILER_ID MATCHES "(Flang|NAG|PGI|SunPro|XL)") +if(test_pp_flags AND NOT CMAKE_Fortran_COMPILER_ID MATCHES "(Flang|NAG|PGI|NVHPC|SunPro|XL)") add_library(no_preprocess_target STATIC no_preprocess_target_upper.F) target_compile_options(no_preprocess_target PRIVATE -DINTEGER=nonsense) add_library(no_preprocess_source STATIC no_preprocess_source_upper.F) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index cffef5a..7339222 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -52,7 +52,7 @@ endmacro() # detailed features tables, not just meta-features if (CMAKE_C_COMPILE_FEATURES) - if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") + if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang)$") set(C_expected_features ${CMAKE_C_COMPILE_FEATURES}) list(FILTER C_expected_features EXCLUDE REGEX "^c_std_[0-9][0-9]") endif() @@ -95,7 +95,7 @@ if (C_expected_features) endif() if (CMAKE_CXX_COMPILE_FEATURES) - if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang)$") set(CXX_expected_features ${CMAKE_CXX_COMPILE_FEATURES}) list(FILTER CXX_expected_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]") endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index bd08dd9..323306a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -268,7 +268,7 @@ add_RunCMake_test(Graphviz) add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(LinkStatic) -if(CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") +if(CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang)$") add_RunCMake_test(MetaCompileFeatures) endif() if(MSVC) diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake index d270005..04b44f6 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake @@ -1,7 +1,7 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) -# PGI compiler doesn't add build id to binaries by default -if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") +# Some compilers do not add build id to binaries by default. +if(CMAKE_CXX_COMPILER_ID MATCHES "^(PGI|NVHPC)$") string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id") string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") endif() -- cgit v0.12