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>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91b9909..4c8c387 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -364,6 +364,7 @@
src/armnn/CompatibleTypes.hpp
src/armnn/Descriptors.cpp
src/armnn/DeviceSpec.hpp
+ src/armnn/DllExport.hpp
src/armnn/DynamicQuantizationVisitor.cpp
src/armnn/DynamicQuantizationVisitor.hpp
src/armnn/Exceptions.cpp
@@ -529,6 +530,8 @@
add_library_ex(armnn SHARED ${armnn_sources})
+target_compile_definitions(armnn PRIVATE "ARMNN_COMPILING_DLL")
+
target_include_directories(armnn PRIVATE src/armnn)
target_include_directories(armnn PRIVATE src/armnnUtils)
target_include_directories(armnn PRIVATE src/backends)
@@ -743,15 +746,15 @@
src/armnnTfLiteParser/test/GetSubgraphInputsOutputs.cpp
src/armnnTfLiteParser/test/GetInputsOutputs.cpp
)
-
- # Generate SchemaText.cpp file which contains the TfLite schema text as a
+
+ # Generate SchemaText.cpp file which contains the TfLite schema text as a
# static C-array of bytes. This is needed at runtime for TfLite parser tests.
add_custom_command(
OUTPUT SchemaText.cpp
COMMAND cp ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs g_TfLiteSchemaText
COMMAND xxd -i g_TfLiteSchemaText SchemaText.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs
+ DEPENDS ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs
)
list(APPEND unittest_sources ${CMAKE_CURRENT_BINARY_DIR}/SchemaText.cpp)
endif()