From: Francis Murtagh <francis.murtagh@arm.com>
Date: Tue, 1 Aug 2023 21:39:26 +0200
Subject: Fix logic so OpenCL is not linked if OPENCL_LIBRARIES

X-Dgit-Generated: 20.08-1 e76ce195d3af29fd378ceb738a1787d7ad1c3ae1

Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 81aa7ae..c7b8ab3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -565,6 +565,10 @@ if (ARMNNTOSAREF)
     endif()
 endif()
 
+if(ARMCOMPUTECL AND OPENCL_LIBRARIES)
+    target_link_libraries(armnn ${OPENCL_LIBRARIES})
+endif()
+
 if(PROFILING_BACKEND_STREAMLINE AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
     target_link_libraries(armnn PUBLIC ${CMAKE_THREAD_LIBS_INIT})
 endif()
