blob: fbd19ede30ebf75f8c30c46b10526bca9f536f4e [file] [log] [blame]
Teresa Charlinad1b3d72023-03-14 12:10:28 +00001#
2# Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3# 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
40 src/Shape.hpp
41 src/SharedFunctions.hpp
42 src/SharedFunctions.cpp
43 src/Slice.hpp
44 src/Softmax.hpp
45 src/SpaceDepth.hpp
46 src/Split.hpp
47 src/Unpack.hpp
Tianle Cheng92ce35c2023-07-25 16:41:00 +010048 src/Tile.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000049 src/Transpose.hpp)
50
51add_library(armnnClassicDelegateObject OBJECT ${armnnClassicDelegateObject_sources})
52
53target_include_directories(armnnClassicDelegateObject
54 PUBLIC
55 $<INSTALL_INTERFACE:include>
56 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
57 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include>
58 PRIVATE
59 ${CMAKE_CURRENT_SOURCE_DIR}/src
60 ${PROJECT_SOURCE_DIR}/common/src)
61
62## Add Tflite dependency
63if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH)
64 find_package(TfLiteSrc REQUIRED MODULE)
65endif()
66
67# Various tflite header files are not warning clean
68# We can't change compilation flags on header files directly, so we need to add them to an interface library first
69add_library(tflite_headers INTERFACE)
70target_include_directories(tflite_headers
71 INTERFACE
72 $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}>
73 $<INSTALL_INTERFACE:include/tflite_headers>)
74
75target_compile_options(tflite_headers
76 INTERFACE
77 -Wno-conversion
78 -Wno-sign-conversion
79 -Wno-unused-parameter
80 -Wno-unused-function)
81
82target_link_libraries(armnnClassicDelegateObject PUBLIC tflite_headers)
83
84## Add Flatbuffers dependency
85find_package(Flatbuffers REQUIRED MODULE)
86
87target_link_libraries(armnnClassicDelegateObject PRIVATE ${Flatbuffers_LIB})
88
89# include/flatbuffers/flatbuffers.h is not warning clean
90# We can't change compilation flags on header files directly, so we need to add them to an interface library first
91add_library(flatbuffer_headers INTERFACE)
92target_include_directories(flatbuffer_headers
93 INTERFACE
94 $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}>
95 $<INSTALL_INTERFACE:include/flatbuffer_headers>)
Matthew Sloyan76d0c4c2023-09-07 14:48:56 +010096target_compile_options(flatbuffer_headers INTERFACE -Wno-sign-conversion -Wno-sign-compare)
Teresa Charlinad1b3d72023-03-14 12:10:28 +000097
98target_link_libraries(armnnClassicDelegateObject PUBLIC flatbuffer_headers)
99
100####################################################
101## Export targets
102install(TARGETS armnnClassicDelegateObject
103 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
104 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})