Skip to content

Commit d65a7d1

Browse files
committed
[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.
1 parent 5c0b3a0 commit d65a7d1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

openmp/libomptarget/plugins-nextgen/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,16 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tmachine}$")
8282
target_include_directories("omptarget.rtl.${tmachine_libname}" PRIVATE
8383
${LIBOMPTARGET_INCLUDE_DIR})
8484

85-
list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.${tmachine_libname}")
86-
set(LIBOMPTARGET_TESTED_PLUGINS
87-
"${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
88-
set(LIBOMPTARGET_SYSTEM_TARGETS
89-
"${LIBOMPTARGET_SYSTEM_TARGETS} ${tmachine_triple} ${tmachine_triple}-LTO" PARENT_SCOPE)
85+
if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
86+
list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.${tmachine_libname}")
87+
set(LIBOMPTARGET_TESTED_PLUGINS
88+
"${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
89+
set(LIBOMPTARGET_SYSTEM_TARGETS
90+
"${LIBOMPTARGET_SYSTEM_TARGETS} ${tmachine_triple}
91+
${tmachine_triple}-LTO" PARENT_SCOPE)
92+
else()
93+
libomptarget_say("Not generating ${tmachine_name} tests. LibFFI not found.")
94+
endif()
9095
else()
9196
libomptarget_say("Not building ${tmachine_name} NextGen offloading plugin: machine not found in the system.")
9297
endif()

0 commit comments

Comments
 (0)