summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2020-12-22 20:07:48 (GMT)
committerBrad King <brad.king@kitware.com>2021-03-31 13:14:38 (GMT)
commita55feff69c7967d56e0935d841cf1ea2c980a43a (patch)
tree4282b5a57c3a20aadc19e0d6a649b53c51ac6f65
parent3c867cff4a98bb198211e3d9f8494fbb478a29e4 (diff)
downloadCMake-a55feff69c7967d56e0935d841cf1ea2c980a43a.zip
CMake-a55feff69c7967d56e0935d841cf1ea2c980a43a.tar.gz
CMake-a55feff69c7967d56e0935d841cf1ea2c980a43a.tar.bz2
Tests: Update for the Fujitsu compiler
-rw-r--r--Tests/CheckFortran.cmake2
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt4
-rw-r--r--Tests/ConfigSources/CMakeLists.txt1
-rw-r--r--Tests/ExportImport/Import/Interface/pch_iface_test.cpp3
-rw-r--r--Tests/Fortran/CMakeLists.txt2
-rw-r--r--Tests/FortranOnly/CMakeLists.txt21
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt5
9 files changed, 25 insertions, 19 deletions
diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake
index 33e1bfb..36293f5 100644
--- a/Tests/CheckFortran.cmake
+++ b/Tests/CheckFortran.cmake
@@ -7,7 +7,7 @@ if(NOT DEFINED CMAKE_Fortran_COMPILER)
message(STATUS ${_desc})
file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran/CMakeLists.txt"
- "cmake_minimum_required(VERSION 2.4)
+ "cmake_minimum_required(VERSION 2.8.12)
project(CheckFortran Fortran)
file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
\"set(CMAKE_Fortran_COMPILER \\\"\${CMAKE_Fortran_COMPILER}\\\")\\n\"
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 7771967..f4fab51 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -18,7 +18,7 @@ macro(run_test feature lang)
endif()
endmacro()
-if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$")
+if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM|Fujitsu)$")
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})
@@ -26,7 +26,7 @@ if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$")
endforeach()
endif()
-if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$")
+if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM|Fujitsu)$")
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/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index a3d98f6..219a972 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.0)
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+
if(NOT _isMultiConfig AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build" FORCE)
endif()
diff --git a/Tests/ExportImport/Import/Interface/pch_iface_test.cpp b/Tests/ExportImport/Import/Interface/pch_iface_test.cpp
index a18bbde..d676a5b 100644
--- a/Tests/ExportImport/Import/Interface/pch_iface_test.cpp
+++ b/Tests/ExportImport/Import/Interface/pch_iface_test.cpp
@@ -3,7 +3,8 @@
# ifndef PCH_PCH_H_INCLUDED
# error "Expected PCH_PCH_H_INCLUDED."
# endif
-#elif defined(__PGIC__) || defined(__ibmxl__) || defined(_CRAYC)
+#elif defined(__PGIC__) || defined(__ibmxl__) || defined(_CRAYC) || \
+ defined(__FUJITSU)
// No PCH expected but these compilers define macros below.
#elif defined(__GNUC__) || defined(__clang__) || defined(_INTEL_COMPILER) || \
defined(_MSC_VER)
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index c1476be..2fc47a5 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -46,7 +46,7 @@ function(test_fortran_c_interface_module)
FortranCInterface_VERIFY()
FortranCInterface_VERIFY(CXX)
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
- if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "SunPro|PathScale|Absoft")
+ if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "SunPro|PathScale|Absoft|Fujitsu")
set(module_expected 1)
endif()
if(FortranCInterface_MODULE_FOUND OR module_expected)
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index b5b5e56..cdf8ed6 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -117,15 +117,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
target_compile_definitions(IntelIfDef PRIVATE SOME_DEF)
endif()
-# Skip these tests if compiler/version doesn't have preprocessing flags
-if((CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.4)
- OR (CMAKE_Fortran_COMPILER_ID STREQUAL "XL" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 15.1.6))
- set(test_pp_flags 0)
-else()
- set(test_pp_flags 1)
-endif()
-
-if(test_pp_flags)
+# Skip these tests if compiler/version does enable and disable preprocessing
+if(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON AND
+ CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF)
# Test that we can always preprocess a target
add_executable(preprocess_target preprocess2.f)
set_property(TARGET preprocess_target PROPERTY Fortran_PREPROCESS ON)
@@ -145,17 +139,22 @@ 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|NVHPC|SunPro|XL)")
+# "don't preprocess" flag, or due to the flags being ignored for
+# extensions like '.F' and '.fpp'.
+if(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF 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)
target_compile_options(no_preprocess_source PRIVATE -DINTEGER=nonsense)
+
if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL "Cray"
AND NOT "${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" MATCHES "Intel(LLVM)?;MSVC")
target_sources(no_preprocess_target PRIVATE no_preprocess_target_fpp.fpp)
target_sources(no_preprocess_source PRIVATE no_preprocess_source_fpp.fpp)
endif()
+
set_property(TARGET no_preprocess_target PROPERTY Fortran_PREPROCESS OFF)
set_property(SOURCE no_preprocess_source_upper.F no_preprocess_source_fpp.fpp PROPERTY Fortran_PREPROCESS OFF)
endif()
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 0cf74bf..d438e54 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|NVHPC|XL|XLClang|IntelLLVM)$")
+ if (NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM|Fujitsu)$")
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|NVHPC|XL|XLClang|IntelLLVM)$")
+ if (NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM|Fujitsu)$")
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 354a04e..3f3c3a0 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -273,7 +273,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|NVHPC|XL|XLClang)$")
+if(CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|Fujitsu)$")
add_RunCMake_test(MetaCompileFeatures)
endif()
if(MSVC)
diff --git a/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt b/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
index abd0628..950ec25 100644
--- a/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
+++ b/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
@@ -43,4 +43,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES SunPro)
target_link_libraries(hello PRIVATE sunquad)
endif()
endif()
+elseif(CMAKE_Fortran_COMPILER_ID MATCHES Fujitsu)
+ # Fujitsu Fortran doesn't automatically link its runtime libraries into
+ # SOs
+ target_link_libraries(world PRIVATE fj90i fj90f fjsrcinfo)
+ target_link_libraries(hello PRIVATE fj90i fj90f fjsrcinfo)
endif()