[OpenMP][cmake] ignore warning on unknown CUDA version
authorKelvin Li <kkwli0@gmail.com>
Mon, 24 Feb 2020 21:11:05 +0000 (16:11 -0500)
committerKelvin Li <kkwli0@gmail.com>
Tue, 25 Feb 2020 14:29:07 +0000 (09:29 -0500)
Differential Revision: https://reviews.llvm.org/D75001

openmp/runtime/cmake/LibompCheckLinkerFlag.cmake

index 81ce9b0..2b6cda6 100644 (file)
@@ -38,7 +38,8 @@ function(libomp_check_linker_flag flag boolean)
 
   if(try_compile_result)
     foreach(regex IN LISTS failed_regexes)
-      if("${OUTPUT}" MATCHES ${regex})
+      # Ignore the warning about the newer or unknown CUDA version.
+      if(("${OUTPUT}" MATCHES ${regex}) AND NOT ("${OUTPUT}" MATCHES "Unknown CUDA version"))
         set(retval FALSE)
       endif()
     endforeach()