blob: ebde7c69ce6439132e8e34482b74e826e1789618 [file] [log] [blame]
Sadik Armagan3c24f432020-10-19 17:35:30 +01001#
Kevin May93bbf002024-03-11 09:31:10 +00002# Copyright © 2022-2024 Arm Ltd and Contributors. All rights reserved.
Sadik Armagan3c24f432020-10-19 17:35:30 +01003# SPDX-License-Identifier: MIT
4#
5
Jan Eilersb968a4f2020-11-15 14:44:43 +00006cmake_minimum_required (VERSION 3.7.0)
Sadik Armagan3c24f432020-10-19 17:35:30 +01007project(armnnDelegate)
Ryan OShea238ecd92023-03-07 11:44:23 +00008set(CMAKE_CXX_STANDARD 17)
9set(CMAKE_CXX_STANDARD_REQUIRED ON)
Ryan OShea238ecd92023-03-07 11:44:23 +000010set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion -Wno-comment")
Finn Williamsbbbefec2020-11-25 14:32:42 +000011set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/")
Sadik Armagan3c24f432020-10-19 17:35:30 +010012
Teresa Charlinad1b3d72023-03-14 12:10:28 +000013option(BUILD_UNIT_TESTS "Build unit tests" ON)
14option(BUILD_CLASSIC_DELEGATE "Build classic delegate" ON)
15option(BUILD_OPAQUE_DELEGATE "Build opaque delegate" OFF)
16option(BUILD_SHARED_LIBS "Build share libs" ON)
17option(BUILD_DELEGATE_JNI_INTERFACE "Builds a library to allow accessing the Arm NN delegate from Java code.
18 This is an experimental feature." ON)
19
Kevin May2c2f3aa2024-05-10 15:40:08 +010020## Do not include flatbuffers::ClassicLocale which can cause abort when destroyed
21add_definitions(-DFLATBUFFERS_LOCALE_INDEPENDENT=0)
22
Sadik Armagan3c24f432020-10-19 17:35:30 +010023set(armnnDelegate_sources)
24list(APPEND armnnDelegate_sources
Teresa Charlinad1b3d72023-03-14 12:10:28 +000025 common/include/DelegateOptions.hpp
26 common/src/DelegateOptions.cpp
David Monahan6c53f9f2023-04-27 15:21:19 +010027 common/src/DelegateUtils.hpp
28 common/src/MultiLayerFacade.hpp)
Sadik Armagan3c24f432020-10-19 17:35:30 +010029
30## Add Armnn as a Dependency
Finn Williamsbbbefec2020-11-25 14:32:42 +000031if(NOT ARMNN_SUB_PROJECT)
32 find_package(Armnn REQUIRED CONFIG HINTS ${Armnn_DIR})
33endif()
Teresa Charlinad1b3d72023-03-14 12:10:28 +000034
35if (BUILD_CLASSIC_DELEGATE)
36 add_subdirectory(classic)
37 add_library(armnnDelegate ${armnnDelegate_sources})
38
39 target_include_directories(armnnDelegate
40 PUBLIC
41 $<INSTALL_INTERFACE:include>
42 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include>
43 PRIVATE
44 ${CMAKE_CURRENT_SOURCE_DIR}/common/src)
45endif()
46if (BUILD_OPAQUE_DELEGATE)
47 add_subdirectory(opaque)
48 add_library(armnnOpaqueDelegate ${armnnDelegate_sources})
49
50 target_include_directories(armnnOpaqueDelegate
51 PUBLIC
52 $<INSTALL_INTERFACE:include>
53 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include>
54 PRIVATE
55 ${CMAKE_CURRENT_SOURCE_DIR}/common/src)
56endif()
57
58include(GNUInstallDirs)
59
60if (BUILD_CLASSIC_DELEGATE)
61 target_link_libraries(armnnDelegate PUBLIC Armnn::Armnn)
62
63 ## Add armnnClassicDelegateObject as a Dependency
64 target_link_libraries(armnnDelegate PUBLIC armnnClassicDelegateObject)
65endif()
66if (BUILD_OPAQUE_DELEGATE)
67 target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::Armnn)
68
69 ## Add armnnOpaqueDelegateObject as a Dependency
70 target_link_libraries(armnnOpaqueDelegate PUBLIC armnnOpaqueDelegateObject)
71endif()
Sadik Armagan3c24f432020-10-19 17:35:30 +010072
Keith Davis9a701c82021-09-28 16:43:24 +010073## Add TfLite dependency
Jim Flynnfca233e2021-09-23 12:16:53 +010074find_package(TfLiteSrc REQUIRED MODULE)
Sadik Armagan3c24f432020-10-19 17:35:30 +010075find_package(TfLite REQUIRED MODULE)
Teresa Charlinad1b3d72023-03-14 12:10:28 +000076if (BUILD_CLASSIC_DELEGATE)
77 target_link_libraries(armnnDelegate PUBLIC ${TfLite_LIB})
Sadik Armagan3c24f432020-10-19 17:35:30 +010078
Teresa Charlinad1b3d72023-03-14 12:10:28 +000079 # lpthread and ldl are not required for Android
80 if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android)
81 target_link_libraries(armnnDelegate PUBLIC -lpthread)
82 target_link_libraries(armnnDelegate PUBLIC -ldl)
83 endif()
Keith Davisd62eef92021-09-20 18:17:33 +010084endif()
Teresa Charlinad1b3d72023-03-14 12:10:28 +000085if (BUILD_OPAQUE_DELEGATE)
86 target_link_libraries(armnnOpaqueDelegate PUBLIC ${TfLite_LIB})
Keith Davisd62eef92021-09-20 18:17:33 +010087
Teresa Charlinad1b3d72023-03-14 12:10:28 +000088 # lpthread and ldl are not required for Android
89 if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android)
90 target_link_libraries(armnnOpaqueDelegate PUBLIC -lpthread)
91 target_link_libraries(armnnOpaqueDelegate PUBLIC -ldl)
92 endif()
93endif()
Sadik Armagan3c24f432020-10-19 17:35:30 +010094
Narumol Prangnawarat4cf0fe32020-12-18 16:13:06 +000095# Add libraries from armnn third-party libraries
96# Third-party header files are not warning clean
97# We can't change compilation flags on header files directly, so we need to add them to an interface library first
98add_library(thirdparty_headers INTERFACE)
99target_include_directories(thirdparty_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/third-party>
100 $<INSTALL_INTERFACE:include/thirdparty_headers>)
101
102target_compile_options(thirdparty_headers INTERFACE -Wno-old-style-cast)
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000103if (BUILD_CLASSIC_DELEGATE)
104 target_link_libraries(armnnDelegate PUBLIC thirdparty_headers)
105endif()
106if (BUILD_OPAQUE_DELEGATE)
107 target_link_libraries(armnnOpaqueDelegate PUBLIC thirdparty_headers)
108endif()
Narumol Prangnawarat4cf0fe32020-12-18 16:13:06 +0000109
Jim Flynnfca233e2021-09-23 12:16:53 +0100110add_library(profiling_library_headers INTERFACE)
111target_include_directories(profiling_library_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/profiling>
112 $<INSTALL_INTERFACE:include/profiling_library_headers>)
Jim Flynnfca233e2021-09-23 12:16:53 +0100113
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000114if (BUILD_CLASSIC_DELEGATE)
115 target_link_libraries(armnnDelegate PUBLIC profiling_library_headers)
116 target_link_libraries(armnnDelegate PUBLIC Armnn::armnnUtils)
Matthew Sloyanac001ee2021-02-03 10:43:04 +0000117
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000118 set_target_properties(armnnDelegate PROPERTIES VERSION ${DELEGATE_LIB_VERSION} SOVERSION ${DELEGATE_LIB_SOVERSION})
119endif()
120if (BUILD_OPAQUE_DELEGATE)
121 target_link_libraries(armnnOpaqueDelegate PUBLIC profiling_library_headers)
122 target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::armnnUtils)
123
124 set_target_properties(armnnOpaqueDelegate PROPERTIES VERSION ${OPAQUE_DELEGATE_LIB_VERSION} SOVERSION ${OPAQUE_DELEGATE_LIB_SOVERSION})
125endif()
126
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100127if(BUILD_UNIT_TESTS)
128 set(commonDelegate_unittest_sources)
129 list(APPEND commonDelegate_unittest_sources
130 common/src/test/DelegateTestInterpreter.hpp
131 common/src/test/DelegateTestInterpreterUtils.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000132 test/ActivationTest.cpp
133 test/ActivationTestHelper.hpp
134 test/ArgMinMaxTest.cpp
135 test/ArgMinMaxTestHelper.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000136 test/BatchMatMulTest.cpp
137 test/BatchMatMulTestHelper.hpp
138 test/BatchSpaceTest.cpp
139 test/BatchSpaceTestHelper.hpp
Idriss Chaouchcbf79292023-09-08 11:18:16 +0100140 test/BroadcastToTest.cpp
141 test/BroadcastToTestHelper.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000142 test/CastTest.cpp
143 test/CastTestHelper.hpp
144 test/ComparisonTest.cpp
145 test/ComparisonTestHelper.hpp
146 test/ControlTest.cpp
147 test/ControlTestHelper.hpp
148 test/Convolution2dTest.cpp
149 test/Convolution3dTest.cpp
150 test/ConvolutionTestHelper.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000151 test/DepthwiseConvolution2dTest.cpp
152 test/ElementwiseBinaryTest.cpp
153 test/ElementwiseBinaryTestHelper.hpp
154 test/ElementwiseUnaryTest.cpp
155 test/ElementwiseUnaryTestHelper.hpp
Matthew Sloyan3504e422023-05-03 13:53:02 +0100156 test/ExpandDimsTest.cpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000157 test/FillTest.cpp
158 test/FillTestHelper.hpp
159 test/FullyConnectedTest.cpp
160 test/FullyConnectedTestHelper.hpp
161 test/GatherTest.cpp
162 test/GatherTestHelper.hpp
163 test/GatherNdTest.cpp
164 test/GatherNdTestHelper.hpp
165 test/LogicalTest.cpp
166 test/LogicalTestHelper.hpp
167 test/LstmTest.cpp
168 test/LstmTestHelper.hpp
169 test/MirrorPadTest.cpp
170 test/NormalizationTest.cpp
171 test/NormalizationTestHelper.hpp
172 test/PackTest.cpp
173 test/PackTestHelper.hpp
174 test/PadTest.cpp
175 test/PadTestHelper.hpp
176 test/Pooling2dTest.cpp
177 test/Pooling2dTestHelper.hpp
178 test/Pooling3dTest.cpp
179 test/Pooling3dTestHelper.hpp
180 test/PreluTest.cpp
181 test/PreluTestHelper.hpp
182 test/QuantizationTest.cpp
183 test/QuantizationTestHelper.hpp
184 test/RedefineTestHelper.hpp
185 test/ReduceTest.cpp
186 test/ReduceTestHelper.hpp
187 test/ReshapeTest.cpp
188 test/ResizeTest.cpp
189 test/ResizeTestHelper.hpp
Tracy Narine7306bbe2023-07-17 16:06:26 +0100190 test/ReverseV2Test.cpp
191 test/ReverseV2TestHelper.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000192 test/RoundTest.cpp
193 test/RoundTestHelper.hpp
Kevin May93bbf002024-03-11 09:31:10 +0000194 test/ScatterNdTest.cpp
195 test/ScatterNdTestHelper.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000196 test/SoftmaxTest.cpp
197 test/SoftmaxTestHelper.hpp
198 test/SpaceDepthTest.cpp
199 test/SpaceDepthTestHelper.hpp
200 test/ShapeTest.cpp
201 test/ShapeTestHelper.hpp
202 test/SliceTest.cpp
203 test/SliceTestHelper.hpp
Matthew Sloyan3504e422023-05-03 13:53:02 +0100204 test/SqueezeTest.cpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000205 test/StridedSliceTest.cpp
206 test/StridedSliceTestHelper.hpp
207 test/SplitTest.cpp
208 test/SplitTestHelper.hpp
209 test/TestUtils.hpp
210 test/TestUtils.cpp
Tianle Cheng92ce35c2023-07-25 16:41:00 +0100211 test/TileTest.cpp
212 test/TileTestHelper.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +0100213 test/TransposeConvolution2dTest.cpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000214 test/TransposeTest.cpp
215 test/TransposeTestHelper.hpp
216 test/UnidirectionalSequenceLstmTest.cpp
217 test/UnidirectionalSequenceLstmTestHelper.hpp
218 test/UnpackTest.cpp
219 test/UnpackTestHelper.hpp)
Sadik Armagan3c24f432020-10-19 17:35:30 +0100220
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100221 # There's a known Android NDK bug which causes a subset of NeonLayerTests to
222 # fail. We'll exclude these tests in NeonLayerTests_NDK_Bug.cpp if we're doing
223 # a debug build and NDK is less than r21.
224 # https://github.com/android/ndk/issues/1135
Keith Davis7c67fab2021-04-08 11:47:23 +0100225
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100226 # Default to always including these tests.
227 set(INCLUDE_NDK_BUG_TESTS "ON")
228 # Reconsider if we in a debug build.
229 string( TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE_LOWERCASE )
230 if ( NOT BUILD_TYPE_LOWERCASE STREQUAL "release" )
231 message("CMAKE:: BUILD TYPE IS ${CMAKE_BUILD_TYPE}")
232 # And NDK_VERSION has been set.
233 if ( DEFINED NDK_VERSION )
234 message("CMAKE:: NDK DEFINED")
235 # And the version is less than r21.
236 if ( ${NDK_VERSION} STRLESS "r21" )
237 message("CMAKE:: BUG TESTS OFF")
238 set(INCLUDE_NDK_BUG_TESTS "OFF")
Keith Davis7c67fab2021-04-08 11:47:23 +0100239 endif()
240 endif()
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100241 endif()
Keith Davis7c67fab2021-04-08 11:47:23 +0100242
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100243 if ( INCLUDE_NDK_BUG_TESTS STREQUAL "ON" )
244 list(APPEND commonDelegate_unittest_sources
245 test/NeonDelegateTests_NDK_Issue.cpp)
246 endif()
Keith Davis7c67fab2021-04-08 11:47:23 +0100247
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100248 if (BUILD_CLASSIC_DELEGATE)
249 set(classicDelegate_unittest_sources)
250 list(APPEND classicDelegate_unittest_sources
251 classic/src/test/ArmnnClassicDelegateTest.cpp
Ryan OShea59f8f652023-05-11 20:37:53 +0100252 classic/src/test/DelegateTestInterpreter.cpp
253 test/DelegateOptionsTest.cpp
254 test/DelegateOptionsTestHelper.hpp)
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100255
256 add_executable(DelegateUnitTests ${commonDelegate_unittest_sources} ${classicDelegate_unittest_sources})
Keith Davis7c67fab2021-04-08 11:47:23 +0100257
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000258 target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}")
Matthew Sloyanebe392d2023-03-30 10:12:08 +0100259 target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common/src/test")
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100260 target_include_directories(DelegateUnitTests PUBLIC ${PROJECT_SOURCE_DIR})
Sadik Armagan3c24f432020-10-19 17:35:30 +0100261
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000262 # Add half library from armnn third-party libraries
263 target_link_libraries(DelegateUnitTests PRIVATE thirdparty_headers)
Ryan OSheaac9607f2023-04-03 11:33:33 +0100264 target_link_libraries(DelegateUnitTests PRIVATE armnnDelegate)
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000265 target_link_libraries(DelegateUnitTests PRIVATE Armnn::armnnUtils)
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000266 target_link_libraries(DelegateUnitTests PRIVATE profiling_library_headers)
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100267 endif()
268
269 if (BUILD_OPAQUE_DELEGATE)
270 set(opaqueDelegate_unittest_sources)
271 list(APPEND opaqueDelegate_unittest_sources
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100272 opaque/src/test/ArmnnOpaqueDelegateTest.cpp
Ryan OShea59f8f652023-05-11 20:37:53 +0100273 opaque/src/test/DelegateTestInterpreter.cpp)
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100274
275 # Until all operators are supported, we have to add tests one by one above to opaqueDelegate_unittest_sources.
276 # After we add can add commonDelegate_unittest_sources to the add_executable below.
Ryan OShea59f8f652023-05-11 20:37:53 +0100277 add_executable(OpaqueDelegateUnitTests ${opaqueDelegate_unittest_sources} ${commonDelegate_unittest_sources})
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100278
279 target_include_directories(OpaqueDelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}")
280 target_include_directories(OpaqueDelegateUnitTests SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common/src/test")
281 target_include_directories(OpaqueDelegateUnitTests PUBLIC ${PROJECT_SOURCE_DIR})
282
283 # Add half library from armnn third-party libraries
284 target_link_libraries(OpaqueDelegateUnitTests PRIVATE thirdparty_headers)
285 target_link_libraries(OpaqueDelegateUnitTests PRIVATE armnnOpaqueDelegate)
286 target_link_libraries(OpaqueDelegateUnitTests PRIVATE Armnn::armnnUtils)
287 target_link_libraries(OpaqueDelegateUnitTests PRIVATE profiling_library_headers)
288 endif()
Sadik Armagan4189cc52020-11-11 18:01:48 +0000289endif()
Sadik Armagan3c24f432020-10-19 17:35:30 +0100290
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100291if(BUILD_DELEGATE_JNI_INTERFACE AND BUILD_CLASSIC_DELEGATE)
Jan Eilersa96489a2021-12-08 10:05:47 +0000292 add_subdirectory(armnnDelegateJNI)
293endif()
294
Sadik Armagan3c24f432020-10-19 17:35:30 +0100295####################################################
296## Export targets
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100297if (BUILD_CLASSIC_DELEGATE)
298 set(armnn_delegate_export_targets)
299 list(APPEND armnn_delegate_export_targets
300 armnnClassicDelegateObject
301 armnnDelegate
302 tflite_headers
303 flatbuffer_headers
304 profiling_library_headers
305 thirdparty_headers)
Sadik Armagan3c24f432020-10-19 17:35:30 +0100306
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100307 install(
308 TARGETS ${armnn_delegate_export_targets}
309 EXPORT armnn-delegate-targets
310 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
311 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
312 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
Sadik Armagan3c24f432020-10-19 17:35:30 +0100313
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100314 ## Set export alias
315 set_target_properties(armnnDelegate
316 PROPERTIES
317 EXPORT_NAME ArmnnDelegate)
Sadik Armagan3c24f432020-10-19 17:35:30 +0100318
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100319 ## Export target scrips
320 install(
321 EXPORT armnn-delegate-targets
322 FILE ArmnnDelegateTargets.cmake
323 NAMESPACE ArmnnDelegate::
324 DESTINATION ${CMAKE_INSTALL_LIBDIR})
Sadik Armagan3c24f432020-10-19 17:35:30 +0100325
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100326 ## Create ArmnnDelegateConfig.cmake
327 include(CMakePackageConfigHelpers)
328 set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR})
329 message(STATUS "CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}" )
330 message(STATUS "CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}" )
331 SET(Armnn_DIR "${Armnn_DIR}")
Finn Williamsbbbefec2020-11-25 14:32:42 +0000332
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100333 configure_package_config_file(
334 ${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/ArmnnDelegateConfig.cmake.in
335 ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateConfig.cmake
336 INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
337 PATH_VARS Armnn_DIR)
Sadik Armagan3c24f432020-10-19 17:35:30 +0100338
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100339 ## Install ArmNN Delegate config file
340 install(
341 FILES
342 ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateConfig.cmake
343 DESTINATION ${INSTALL_CONFIGDIR})
Sadik Armagan3c24f432020-10-19 17:35:30 +0100344
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100345 ## Export from build tree
346 export(
347 EXPORT armnn-delegate-targets
348 FILE ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateTargets.cmake
349 NAMESPACE ArmnnDelegate::)
350 add_library(ArmnnDelegate::ArmnnDelegate ALIAS armnnDelegate)
351endif()
Sadik Armagan3c24f432020-10-19 17:35:30 +0100352
Narumol Prangnawarat50c87d32020-11-09 18:42:11 +0000353####################################################
Narumol Prangnawarat46e574e2023-05-05 16:39:05 +0100354## Export opaque delegate targets
355
356if(BUILD_OPAQUE_DELEGATE)
357 set(armnn_opaque_delegate_export_targets)
358 list(APPEND armnn_opaque_delegate_export_targets
359 armnnOpaqueDelegateObject
360 armnnOpaqueDelegate
361 tflite_headers
362 flatbuffer_headers
363 profiling_library_headers
364 thirdparty_headers)
365
366 install(
367 TARGETS armnnOpaqueDelegate
368 EXPORT armnn-opaque-delegate-targets
369 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
370 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
371 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
372
373 ## Set export alias
374 set_target_properties(armnnOpaqueDelegate
375 PROPERTIES
376 EXPORT_NAME ArmnnOpaqueDelegate)
377
378 add_library(ArmnnDelegate::ArmnnOpaqueDelegate ALIAS armnnOpaqueDelegate)
379endif()
380
381####################################################