endif()
#######################################################################
-if (UNIX AND ENABLE_LOADABLE_DRIVERS)
+if(UNIX AND HAVE_DLFCN_H)
+if(ENABLE_ICD)
add_test(NAME pocl_test_dlopen_libpocl COMMAND test_dlopen)
set_tests_properties("pocl_test_dlopen_libpocl" PROPERTIES LABELS "internal;dlopen;vulkan")
set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_libpocl")
+endif()
+
+if(ENABLE_LOADABLE_DRIVERS)
if(BUILD_BASIC)
add_test(NAME pocl_test_dlopen_device_basic COMMAND test_dlopen basic)
set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_vulkan")
endif()
-endif ()
+endif()
+
+endif()
#######################################################################
add_subdirectory("kernel")
SHLIB_ORIGIN "/../../lib/CL/devices/%s/libpocl-devices-%s.so", argv[1],
argv[1]);
+#ifdef ENABLE_ICD
void *handle_libpocl = dlopen (libpocl, RTLD_NOW | RTLD_GLOBAL);
if (!handle_libpocl)
{
libpocl, dlerror ());
ret = 1;
}
+#endif
if (ret == 0 && argc > 1)
{
dlclose (handle_device);
}
+#ifdef ENABLE_ICD
if (handle_libpocl)
dlclose (handle_libpocl);
+#endif
return ret;
}