aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorRyan OShea <ryan.oshea3@arm.com>2022-07-06 09:52:52 +0100
committerRyan OShea <ryan.oshea3@arm.com>2023-01-06 16:21:40 +0000
commitb5540547d615b7fb642018f426eaedfd70e85c6c (patch)
tree6d3d472ec773eff8cfd3905e63e41fa09989d67d /tests/CMakeLists.txt
parent69b67d89c018981e1d4654ba7adfa6d4d64a813c (diff)
downloadarmnn-b5540547d615b7fb642018f426eaedfd70e85c6c.tar.gz
IVGCVSW-7031 Generate static execute network
* Build ExecNet lib dependencies as object libs except libarmnn * Disable PIPE when building static ExecNet * Remove multiple definition from AsyncExecutionCallback * Disable DynamicBackend for ExecNet Static build * Disable inference tests for TfLiteParser and ONNX during static ExecNet * Remove Tensorflow Parser if condition * Add Disable thread macro to InferenceModel * Don't compile dynamic backend symbols in Runtime.cpp for Baremetal and Exenet Static Signed-off-by: Ryan OShea <ryan.oshea3@arm.com> Change-Id: If41c063eab5f05b3df0a6e064924a36a177f116a
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt44
1 files changed, 26 insertions, 18 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index dd18a322ea..4c89267a1a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright © 2018-2022 Arm Ltd and Contributors. All rights reserved.
+# Copyright © 2018-2023 Arm Ltd and Contributors. All rights reserved.
# SPDX-License-Identifier: MIT
#
@@ -21,7 +21,7 @@ target_include_directories(inferenceTest PRIVATE ../src/armnnUtils)
target_include_directories(inferenceTest PRIVATE ../src/backends)
target_include_directories(inferenceTest PRIVATE ../third-party/stb)
-if (BUILD_TF_LITE_PARSER)
+if (BUILD_TF_LITE_PARSER AND NOT EXECUTE_NETWORK_STATIC)
macro(TfLiteParserTest testName sources)
add_executable_ex(${testName} ${sources})
target_include_directories(${testName} PRIVATE ../src/armnnUtils)
@@ -112,7 +112,7 @@ if (BUILD_TF_LITE_PARSER)
endif()
-if (BUILD_ONNX_PARSER)
+if (BUILD_ONNX_PARSER AND NOT EXECUTE_NETWORK_STATIC)
macro(OnnxParserTest testName sources)
add_executable_ex(${testName} ${sources})
target_include_directories(${testName} PRIVATE ../src/armnnUtils)
@@ -139,7 +139,6 @@ if (BUILD_ONNX_PARSER)
endif()
if (BUILD_ARMNN_SERIALIZER
- OR BUILD_TF_PARSER
OR BUILD_TF_LITE_PARSER
OR BUILD_ONNX_PARSER
OR BUILD_ARMNN_TFLITE_DELEGATE)
@@ -168,21 +167,30 @@ if (BUILD_ARMNN_SERIALIZER
target_include_directories(ExecuteNetwork PRIVATE ../src/armnnUtils)
target_include_directories(ExecuteNetwork PRIVATE ../src/backends)
target_include_directories(ExecuteNetwork PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
-
- if (BUILD_ARMNN_SERIALIZER)
- target_link_libraries(ExecuteNetwork armnnSerializer)
- endif()
-
- if (BUILD_TF_LITE_PARSER)
- target_link_libraries(ExecuteNetwork armnnTfLiteParser)
- endif()
- if (BUILD_ONNX_PARSER)
- target_link_libraries(ExecuteNetwork armnnOnnxParser)
- endif()
- if (BUILD_ARMNN_TFLITE_DELEGATE)
- target_link_libraries(ExecuteNetwork ArmnnDelegate::ArmnnDelegate)
+ if(EXECUTE_NETWORK_STATIC)
+ target_link_libraries(ExecuteNetwork
+ -Wl,--whole-archive
+ armnnSerializer
+ armnnTfLiteParser
+ armnn
+ pthread
+ -Wl,--no-whole-archive
+ )
+ else()
+ if (BUILD_ARMNN_SERIALIZER)
+ target_link_libraries(ExecuteNetwork armnnSerializer)
+ endif()
+ if (BUILD_TF_LITE_PARSER)
+ target_link_libraries(ExecuteNetwork armnnTfLiteParser)
+ endif()
+ if (BUILD_ONNX_PARSER)
+ target_link_libraries(ExecuteNetwork armnnOnnxParser)
+ endif()
+ if (BUILD_ARMNN_TFLITE_DELEGATE)
+ target_link_libraries(ExecuteNetwork ArmnnDelegate::ArmnnDelegate)
+ endif()
+ target_link_libraries(ExecuteNetwork armnn)
endif()
- target_link_libraries(ExecuteNetwork armnn)
target_link_libraries(ExecuteNetwork ${CMAKE_THREAD_LIBS_INIT})
addDllCopyCommands(ExecuteNetwork)