blob: 72ecc28d97fb0d874f15744a3b0137b3f19984cf [file] [log] [blame]
Teresa Charlinad1b3d72023-03-14 12:10:28 +00001#
Kevin May93bbf002024-03-11 09:31:10 +00002# Copyright © 2023-2024 Arm Ltd and Contributors. All rights reserved.
Teresa Charlinad1b3d72023-03-14 12:10:28 +00003# SPDX-License-Identifier: MIT
4#
5
6set(armnnClassicDelegateObject_sources)
7list(APPEND armnnClassicDelegateObject_sources
8 include/armnn_delegate.hpp
9 include/Version.hpp
10 src/armnn_delegate.cpp
11 src/armnn_external_delegate.cpp
12 src/Activation.hpp
13 src/ArgMinMax.hpp
14 src/BatchMatMul.hpp
15 src/BatchSpace.hpp
Idriss Chaouchcbf79292023-09-08 11:18:16 +010016 src/BroadcastTo.hpp
Matthew Sloyan11572322023-03-16 10:17:51 +000017 src/ClassicDelegateUtils.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000018 src/Comparison.hpp
19 src/Convolution.hpp
20 src/Control.hpp
21 src/ElementwiseBinary.hpp
22 src/ElementwiseUnary.hpp
23 src/Fill.hpp
24 src/FullyConnected.hpp
25 src/Gather.hpp
26 src/GatherNd.hpp
27 src/LogicalBinary.hpp
28 src/Lstm.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000029 src/Normalization.hpp
30 src/Pack.hpp
31 src/Pad.hpp
32 src/Pooling.hpp
33 src/Prelu.hpp
34 src/Quantization.hpp
35 src/Redefine.hpp
36 src/Reduce.hpp
37 src/Resize.hpp
Tracy Narine7306bbe2023-07-17 16:06:26 +010038 src/ReverseV2.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000039 src/Round.hpp
Kevin May93bbf002024-03-11 09:31:10 +000040 src/ScatterNd.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000041 src/Shape.hpp
42 src/SharedFunctions.hpp
43 src/SharedFunctions.cpp
44 src/Slice.hpp
45 src/Softmax.hpp
46 src/SpaceDepth.hpp
47 src/Split.hpp
48 src/Unpack.hpp
Tianle Cheng92ce35c2023-07-25 16:41:00 +010049 src/Tile.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000050 src/Transpose.hpp)
51
52add_library(armnnClassicDelegateObject OBJECT ${armnnClassicDelegateObject_sources})
53
54target_include_directories(armnnClassicDelegateObject
55 PUBLIC
56 $<INSTALL_INTERFACE:include>
57 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
58 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include>
59 PRIVATE
60 ${CMAKE_CURRENT_SOURCE_DIR}/src
61 ${PROJECT_SOURCE_DIR}/common/src)
62
63## Add Tflite dependency
64if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH)
65 find_package(TfLiteSrc REQUIRED MODULE)
66endif()
67
68# Various tflite header files are not warning clean
69# We can't change compilation flags on header files directly, so we need to add them to an interface library first
70add_library(tflite_headers INTERFACE)
71target_include_directories(tflite_headers
72 INTERFACE
73 $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}>
74 $<INSTALL_INTERFACE:include/tflite_headers>)
75
76target_compile_options(tflite_headers
77 INTERFACE
78 -Wno-conversion
79 -Wno-sign-conversion
80 -Wno-unused-parameter
81 -Wno-unused-function)
82
83target_link_libraries(armnnClassicDelegateObject PUBLIC tflite_headers)
84
85## Add Flatbuffers dependency
86find_package(Flatbuffers REQUIRED MODULE)
87
88target_link_libraries(armnnClassicDelegateObject PRIVATE ${Flatbuffers_LIB})
89
90# include/flatbuffers/flatbuffers.h is not warning clean
91# We can't change compilation flags on header files directly, so we need to add them to an interface library first
92add_library(flatbuffer_headers INTERFACE)
93target_include_directories(flatbuffer_headers
94 INTERFACE
95 $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}>
96 $<INSTALL_INTERFACE:include/flatbuffer_headers>)
Matthew Sloyan76d0c4c2023-09-07 14:48:56 +010097target_compile_options(flatbuffer_headers INTERFACE -Wno-sign-conversion -Wno-sign-compare)
Teresa Charlinad1b3d72023-03-14 12:10:28 +000098
99target_link_libraries(armnnClassicDelegateObject PUBLIC flatbuffer_headers)
100
101####################################################
102## Export targets
103install(TARGETS armnnClassicDelegateObject
104 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
105 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})