[Openmp-commits] [PATCH] D87191: [CMake][OpenMP] Remove old dead CMake code

Raul Tambre via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Sep 7 00:57:06 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG21c0e74c9e7f: [CMake][OpenMP] Remove old dead CMake code (authored by tambre).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87191/new/

https://reviews.llvm.org/D87191

Files:
  openmp/cmake/OpenMPTesting.cmake
  openmp/runtime/cmake/LibompCheckFortranFlag.cmake


Index: openmp/runtime/cmake/LibompCheckFortranFlag.cmake
===================================================================
--- openmp/runtime/cmake/LibompCheckFortranFlag.cmake
+++ openmp/runtime/cmake/LibompCheckFortranFlag.cmake
@@ -19,54 +19,9 @@
            print *, \"Hello World!\"
       end program hello")
 
-  set(failed_regexes "[Ee]rror;[Uu]nknown;[Ss]kipping")
-  if(CMAKE_VERSION VERSION_GREATER 3.1 OR CMAKE_VERSION VERSION_EQUAL 3.1)
+    set(failed_regexes "[Ee]rror;[Uu]nknown;[Ss]kipping")
     include(CheckFortranSourceCompiles)
     check_fortran_source_compiles("${fortran_source}" ${boolean} FAIL_REGEX "${failed_regexes}")
     set(${boolean} ${${boolean}} PARENT_SCOPE)
-    return()
-  else()
-    # Our manual check for cmake versions that don't have CheckFortranSourceCompiles
-    set(base_dir ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_flag_check)
-    file(MAKE_DIRECTORY ${base_dir})
-    file(WRITE ${base_dir}/fortran_source.f "${fortran_source}")
-
-    message(STATUS "Performing Test ${boolean}")
-    execute_process(
-      COMMAND ${CMAKE_Fortran_COMPILER} "${flag}" ${base_dir}/fortran_source.f
-      WORKING_DIRECTORY ${base_dir}
-      RESULT_VARIABLE exit_code
-      OUTPUT_VARIABLE OUTPUT
-      ERROR_VARIABLE OUTPUT
-    )
-
-    if(${exit_code} EQUAL 0)
-      foreach(regex IN LISTS failed_regexes)
-        if("${OUTPUT}" MATCHES ${regex})
-          set(retval FALSE)
-        endif()
-      endforeach()
-    else()
-      set(retval FALSE)
-    endif()
-
-    if(${retval})
-      set(${boolean} 1 CACHE INTERNAL "Test ${boolean}")
-      message(STATUS "Performing Test ${boolean} - Success")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-        "Performing Fortran Compiler Flag test ${boolean} succeeded with the following output:\n"
-        "${OUTPUT}\n"
-        "Source file was:\n${fortran_source}\n")
-    else()
-      set(${boolean} "" CACHE INTERNAL "Test ${boolean}")
-      message(STATUS "Performing Test ${boolean} - Failed")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-        "Performing Fortran Compiler Flag test ${boolean} failed with the following output:\n"
-        "${OUTPUT}\n"
-        "Source file was:\n${fortran_source}\n")
-    endif()
-  endif()
-
-  set(${boolean} ${retval} PARENT_SCOPE)
   endif()
 endfunction()
Index: openmp/cmake/OpenMPTesting.cmake
===================================================================
--- openmp/cmake/OpenMPTesting.cmake
+++ openmp/cmake/OpenMPTesting.cmake
@@ -50,13 +50,6 @@
 if (${OPENMP_STANDALONE_BUILD})
   find_standalone_test_dependencies()
 
-  # Make sure we can use the console pool for recent CMake and Ninja > 1.5.
-  if (CMAKE_VERSION VERSION_LESS 3.1.20141117)
-    set(cmake_3_2_USES_TERMINAL)
-  else()
-    set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
-  endif()
-
   # Set lit arguments.
   set(DEFAULT_LIT_ARGS "-sv --show-unsupported --show-xfail")
   if (MSVC OR XCODE)
@@ -189,7 +182,7 @@
       COMMAND ${PYTHON_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
       COMMENT ${comment}
       DEPENDS ${ARG_DEPENDS}
-      ${cmake_3_2_USES_TERMINAL}
+      USES_TERMINAL
     )
   else()
     if (ARG_EXCLUDE_FROM_CHECK_ALL)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87191.290194.patch
Type: text/x-patch
Size: 3297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200907/14c854e5/attachment.bin>


More information about the Openmp-commits mailing list