mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-06 07:40:53 +00:00
Tests: Update tests for NVHPC compiler
Treat it just like PGI.
This commit is contained in:
@@ -15,7 +15,7 @@ macro(run_test feature lang)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
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)
|
get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES)
|
||||||
list(FILTER c_features EXCLUDE REGEX "^c_std_[0-9][0-9]")
|
list(FILTER c_features EXCLUDE REGEX "^c_std_[0-9][0-9]")
|
||||||
foreach(feature ${c_features})
|
foreach(feature ${c_features})
|
||||||
@@ -23,7 +23,7 @@ if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$")
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
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)
|
get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
|
||||||
list(FILTER cxx_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]")
|
list(FILTER cxx_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]")
|
||||||
foreach(feature ${cxx_features})
|
foreach(feature ${cxx_features})
|
||||||
|
|||||||
@@ -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.
|
# Test that we can explicitly not preprocess a target or source.
|
||||||
# This will not work on certain compilers due to either missing a
|
# This will not work on certain compilers due to either missing a
|
||||||
# "don't preprocess" flag, or due to choice of file extension.
|
# "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)
|
add_library(no_preprocess_target STATIC no_preprocess_target_upper.F)
|
||||||
target_compile_options(no_preprocess_target PRIVATE -DINTEGER=nonsense)
|
target_compile_options(no_preprocess_target PRIVATE -DINTEGER=nonsense)
|
||||||
add_library(no_preprocess_source STATIC no_preprocess_source_upper.F)
|
add_library(no_preprocess_source STATIC no_preprocess_source_upper.F)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ endmacro()
|
|||||||
# detailed features tables, not just meta-features
|
# detailed features tables, not just meta-features
|
||||||
|
|
||||||
if (CMAKE_C_COMPILE_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})
|
set(C_expected_features ${CMAKE_C_COMPILE_FEATURES})
|
||||||
list(FILTER C_expected_features EXCLUDE REGEX "^c_std_[0-9][0-9]")
|
list(FILTER C_expected_features EXCLUDE REGEX "^c_std_[0-9][0-9]")
|
||||||
endif()
|
endif()
|
||||||
@@ -95,7 +95,7 @@ if (C_expected_features)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILE_FEATURES)
|
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})
|
set(CXX_expected_features ${CMAKE_CXX_COMPILE_FEATURES})
|
||||||
list(FILTER CXX_expected_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]")
|
list(FILTER CXX_expected_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ add_RunCMake_test(Graphviz)
|
|||||||
add_RunCMake_test(TargetPropertyGeneratorExpressions)
|
add_RunCMake_test(TargetPropertyGeneratorExpressions)
|
||||||
add_RunCMake_test(Languages)
|
add_RunCMake_test(Languages)
|
||||||
add_RunCMake_test(LinkStatic)
|
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)
|
add_RunCMake_test(MetaCompileFeatures)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
|
||||||
|
|
||||||
# PGI compiler doesn't add build id to binaries by default
|
# Some compilers do not add build id to binaries by default.
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "^(PGI|NVHPC)$")
|
||||||
string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id")
|
string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id")
|
||||||
string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id")
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user