Skip to content

Commit 21c0e74

Browse files
committed
[CMake][OpenMP] Remove old dead CMake code
LLVM requires CMake 3.13.4 so remove code behind checks for an older version. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D87191
1 parent 098130f commit 21c0e74

File tree

2 files changed

+2
-54
lines changed

2 files changed

+2
-54
lines changed

openmp/cmake/OpenMPTesting.cmake

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ endfunction()
5050
if (${OPENMP_STANDALONE_BUILD})
5151
find_standalone_test_dependencies()
5252

53-
# Make sure we can use the console pool for recent CMake and Ninja > 1.5.
54-
if (CMAKE_VERSION VERSION_LESS 3.1.20141117)
55-
set(cmake_3_2_USES_TERMINAL)
56-
else()
57-
set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
58-
endif()
59-
6053
# Set lit arguments.
6154
set(DEFAULT_LIT_ARGS "-sv --show-unsupported --show-xfail")
6255
if (MSVC OR XCODE)
@@ -189,7 +182,7 @@ function(add_openmp_testsuite target comment)
189182
COMMAND ${PYTHON_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
190183
COMMENT ${comment}
191184
DEPENDS ${ARG_DEPENDS}
192-
${cmake_3_2_USES_TERMINAL}
185+
USES_TERMINAL
193186
)
194187
else()
195188
if (ARG_EXCLUDE_FROM_CHECK_ALL)

openmp/runtime/cmake/LibompCheckFortranFlag.cmake

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,54 +19,9 @@ function(libomp_check_fortran_flag flag boolean)
1919
print *, \"Hello World!\"
2020
end program hello")
2121

22-
set(failed_regexes "[Ee]rror;[Uu]nknown;[Ss]kipping")
23-
if(CMAKE_VERSION VERSION_GREATER 3.1 OR CMAKE_VERSION VERSION_EQUAL 3.1)
22+
set(failed_regexes "[Ee]rror;[Uu]nknown;[Ss]kipping")
2423
include(CheckFortranSourceCompiles)
2524
check_fortran_source_compiles("${fortran_source}" ${boolean} FAIL_REGEX "${failed_regexes}")
2625
set(${boolean} ${${boolean}} PARENT_SCOPE)
27-
return()
28-
else()
29-
# Our manual check for cmake versions that don't have CheckFortranSourceCompiles
30-
set(base_dir ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_flag_check)
31-
file(MAKE_DIRECTORY ${base_dir})
32-
file(WRITE ${base_dir}/fortran_source.f "${fortran_source}")
33-
34-
message(STATUS "Performing Test ${boolean}")
35-
execute_process(
36-
COMMAND ${CMAKE_Fortran_COMPILER} "${flag}" ${base_dir}/fortran_source.f
37-
WORKING_DIRECTORY ${base_dir}
38-
RESULT_VARIABLE exit_code
39-
OUTPUT_VARIABLE OUTPUT
40-
ERROR_VARIABLE OUTPUT
41-
)
42-
43-
if(${exit_code} EQUAL 0)
44-
foreach(regex IN LISTS failed_regexes)
45-
if("${OUTPUT}" MATCHES ${regex})
46-
set(retval FALSE)
47-
endif()
48-
endforeach()
49-
else()
50-
set(retval FALSE)
51-
endif()
52-
53-
if(${retval})
54-
set(${boolean} 1 CACHE INTERNAL "Test ${boolean}")
55-
message(STATUS "Performing Test ${boolean} - Success")
56-
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
57-
"Performing Fortran Compiler Flag test ${boolean} succeeded with the following output:\n"
58-
"${OUTPUT}\n"
59-
"Source file was:\n${fortran_source}\n")
60-
else()
61-
set(${boolean} "" CACHE INTERNAL "Test ${boolean}")
62-
message(STATUS "Performing Test ${boolean} - Failed")
63-
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
64-
"Performing Fortran Compiler Flag test ${boolean} failed with the following output:\n"
65-
"${OUTPUT}\n"
66-
"Source file was:\n${fortran_source}\n")
67-
endif()
68-
endif()
69-
70-
set(${boolean} ${retval} PARENT_SCOPE)
7126
endif()
7227
endfunction()

0 commit comments

Comments
 (0)