From 91e1d89ad35ad081a4d5995d541791fbefdb3060 Mon Sep 17 00:00:00 2001 From: Rob Hughes Date: Fri, 23 Aug 2019 10:11:58 +0100 Subject: Fix Windows build: * CMake "install" commands require a RUNTIME argument for platforms with DLLs (e.g. Windows). * Replace use of non-standard variable length array with vector * Remove unnecessary #include of unistd.h * Add #ifdefs to dynamic backend code to disable for non-Unix platforms where you can't use dlopen etc. We could implement this properly for Windows later using LoadLibrary etc., but for now erroring is fine. * Add missing #include of Change-Id: Ic8ef5fd599b37bf8772510157b6e479819f6a1eb --- src/backends/backendsCommon/DynamicBackendUtils.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/backends/backendsCommon/DynamicBackendUtils.hpp') diff --git a/src/backends/backendsCommon/DynamicBackendUtils.hpp b/src/backends/backendsCommon/DynamicBackendUtils.hpp index 0aa0ac8da5..6d9f11d215 100644 --- a/src/backends/backendsCommon/DynamicBackendUtils.hpp +++ b/src/backends/backendsCommon/DynamicBackendUtils.hpp @@ -10,11 +10,13 @@ #include +#include + #include -#include #include - -#include +#if defined(__unix__) +#include +#endif #if !defined(DYNAMIC_BACKEND_PATHS) #define DYNAMIC_BACKEND_PATHS "" @@ -58,6 +60,7 @@ private: template EntryPointType DynamicBackendUtils::GetEntryPoint(const void* sharedObjectHandle, const char* symbolName) { +#if defined(__unix__) if (sharedObjectHandle == nullptr) { throw RuntimeException("GetEntryPoint error: invalid handle"); @@ -75,6 +78,9 @@ EntryPointType DynamicBackendUtils::GetEntryPoint(const void* sharedObjectHandle } return entryPoint; +#else + throw RuntimeException("Dynamic backends not supported on this platform"); +#endif } } // namespace armnn -- cgit v1.2.1