blob: 780715335999bcab6e769ba987b83d2cfa394c5e [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
Matthew Sloyan11572322023-03-16 10:17:51 +000016 src/ClassicDelegateUtils.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000017 src/Comparison.hpp
18 src/Convolution.hpp
19 src/Control.hpp
20 src/ElementwiseBinary.hpp
21 src/ElementwiseUnary.hpp
22 src/Fill.hpp
23 src/FullyConnected.hpp
24 src/Gather.hpp
25 src/GatherNd.hpp
26 src/LogicalBinary.hpp
27 src/Lstm.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000028 src/Normalization.hpp
29 src/Pack.hpp
30 src/Pad.hpp
31 src/Pooling.hpp
32 src/Prelu.hpp
33 src/Quantization.hpp
34 src/Redefine.hpp
35 src/Reduce.hpp
36 src/Resize.hpp
Tracy Narine7306bbe2023-07-17 16:06:26 +010037 src/ReverseV2.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000038 src/Round.hpp
39 src/Shape.hpp
40 src/SharedFunctions.hpp
41 src/SharedFunctions.cpp
42 src/Slice.hpp
43 src/Softmax.hpp
44 src/SpaceDepth.hpp
45 src/Split.hpp
46 src/Unpack.hpp
Tianle Cheng92ce35c2023-07-25 16:41:00 +010047 src/Tile.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +000048 src/Transpose.hpp)
49
50add_library(armnnClassicDelegateObject OBJECT ${armnnClassicDelegateObject_sources})
51
52target_include_directories(armnnClassicDelegateObject
53 PUBLIC
54 $<INSTALL_INTERFACE:include>
55 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
56 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include>
57 PRIVATE
58 ${CMAKE_CURRENT_SOURCE_DIR}/src
59 ${PROJECT_SOURCE_DIR}/common/src)
60
61## Add Tflite dependency
62if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH)
63 find_package(TfLiteSrc REQUIRED MODULE)
64endif()
65
66# Various tflite header files are not warning clean
67# We can't change compilation flags on header files directly, so we need to add them to an interface library first
68add_library(tflite_headers INTERFACE)
69target_include_directories(tflite_headers
70 INTERFACE
71 $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}>
72 $<INSTALL_INTERFACE:include/tflite_headers>)
73
74target_compile_options(tflite_headers
75 INTERFACE
76 -Wno-conversion
77 -Wno-sign-conversion
78 -Wno-unused-parameter
79 -Wno-unused-function)
80
81target_link_libraries(armnnClassicDelegateObject PUBLIC tflite_headers)
82
83## Add Flatbuffers dependency
84find_package(Flatbuffers REQUIRED MODULE)
85
86target_link_libraries(armnnClassicDelegateObject PRIVATE ${Flatbuffers_LIB})
87
88# include/flatbuffers/flatbuffers.h is not warning clean
89# We can't change compilation flags on header files directly, so we need to add them to an interface library first
90add_library(flatbuffer_headers INTERFACE)
91target_include_directories(flatbuffer_headers
92 INTERFACE
93 $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}>
94 $<INSTALL_INTERFACE:include/flatbuffer_headers>)
95target_compile_options(flatbuffer_headers INTERFACE -Wno-sign-conversion)
96
97target_link_libraries(armnnClassicDelegateObject PUBLIC flatbuffer_headers)
98
99####################################################
100## Export targets
101install(TARGETS armnnClassicDelegateObject
102 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
103 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})