[Openmp-commits] [openmp] d65a7d1 - [Libomptarget] Do not run CPU tests if FFI was not found

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 10 05:22:33 PST 2024


Author: Joseph Huber
Date: 2024-01-10T07:22:23-06:00
New Revision: d65a7d1f1a2139f927949ab6b1a9d90113de9a90

URL: https://github.com/llvm/llvm-project/commit/d65a7d1f1a2139f927949ab6b1a9d90113de9a90
DIFF: https://github.com/llvm/llvm-project/commit/d65a7d1f1a2139f927949ab6b1a9d90113de9a90.diff

LOG: [Libomptarget] Do not run CPU tests if FFI was not found

Summary:
The previous behaviour before I made it dynamically open libFFI was that
these tests would be ignored if FFI was not found. This now allows tests
to be run without the dependency and thus the tests fails on some
buildbots. This simply makesit not build the tests if it's not present.

Added: 
    

Modified: 
    openmp/libomptarget/plugins-nextgen/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins-nextgen/CMakeLists.txt b/openmp/libomptarget/plugins-nextgen/CMakeLists.txt
index 882be3025003b0..9b4e94550239c7 100644
--- a/openmp/libomptarget/plugins-nextgen/CMakeLists.txt
+++ b/openmp/libomptarget/plugins-nextgen/CMakeLists.txt
@@ -82,11 +82,16 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tmachine}$")
   target_include_directories("omptarget.rtl.${tmachine_libname}" PRIVATE
                              ${LIBOMPTARGET_INCLUDE_DIR})
 
-  list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.${tmachine_libname}")
-  set(LIBOMPTARGET_TESTED_PLUGINS
-      "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
-  set(LIBOMPTARGET_SYSTEM_TARGETS 
-      "${LIBOMPTARGET_SYSTEM_TARGETS} ${tmachine_triple} ${tmachine_triple}-LTO" PARENT_SCOPE)
+  if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
+    list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.${tmachine_libname}")
+    set(LIBOMPTARGET_TESTED_PLUGINS
+        "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
+    set(LIBOMPTARGET_SYSTEM_TARGETS
+        "${LIBOMPTARGET_SYSTEM_TARGETS} ${tmachine_triple}
+        ${tmachine_triple}-LTO" PARENT_SCOPE)
+  else()
+    libomptarget_say("Not generating ${tmachine_name} tests. LibFFI not found.")
+  endif()
 else()
   libomptarget_say("Not building ${tmachine_name} NextGen offloading plugin: machine not found in the system.")
 endif()


        


More information about the Openmp-commits mailing list