diff options
author | Rob Hughes <robert.hughes@arm.com> | 2020-01-07 09:40:12 +0000 |
---|---|---|
committer | Rob Hughes <robert.hughes@arm.com> | 2020-01-24 11:26:42 +0000 |
commit | a91479cdcc4e8206a12f43838b0bbdc6ef7f6bb0 (patch) | |
tree | 831e2107c7a6f981f77a6609d812f7178a17066c /src/armnn | |
parent | d466a54e79560f0ccacc6b13cd64e08defbac47c (diff) | |
download | armnn-a91479cdcc4e8206a12f43838b0bbdc6ef7f6bb0.tar.gz |
Add ARMNN_DLLEXPORT macro to import/export static data symbols on Windows
Armnn has several static data symbols that are needed by the unit tests.
These are now explicitly marked for import when that header is included
from the unit test code.
See also https://cmake.org/cmake/help/v3.4/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html.
Change-Id: I4e71ba659b6321659a1396125b5a9c271578040f
Signed-off-by: Robert Hughes <robert.hughes@arm.com>
Diffstat (limited to 'src/armnn')
-rw-r--r-- | src/armnn/DllExport.hpp | 19 | ||||
-rw-r--r-- | src/armnn/WallClockTimer.hpp | 3 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/armnn/DllExport.hpp b/src/armnn/DllExport.hpp new file mode 100644 index 0000000000..227028c9b7 --- /dev/null +++ b/src/armnn/DllExport.hpp @@ -0,0 +1,19 @@ +// +// Copyright © 2020 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// +#pragma once + +#if defined (_MSC_VER) + +#ifdef ARMNN_COMPILING_DLL +#define ARMNN_DLLEXPORT __declspec(dllexport) +#else +#define ARMNN_DLLEXPORT __declspec(dllimport) +#endif + +#else + +#define ARMNN_DLLEXPORT + +#endif
\ No newline at end of file diff --git a/src/armnn/WallClockTimer.hpp b/src/armnn/WallClockTimer.hpp index ff17d79e92..23e1bc689b 100644 --- a/src/armnn/WallClockTimer.hpp +++ b/src/armnn/WallClockTimer.hpp @@ -7,6 +7,7 @@ #include "Instrument.hpp" #include <chrono> +#include "DllExport.hpp" namespace armnn { @@ -59,7 +60,7 @@ public: using clock = std::chrono::steady_clock; #endif - static const std::string WALL_CLOCK_TIME; + ARMNN_DLLEXPORT static const std::string WALL_CLOCK_TIME; static const std::string WALL_CLOCK_TIME_START; static const std::string WALL_CLOCK_TIME_STOP; |