blob: 54e00e1c9ffdff1fead796ada1af29340b324f19 [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
37 src/Round.hpp
38 src/Shape.hpp
39 src/SharedFunctions.hpp
40 src/SharedFunctions.cpp
41 src/Slice.hpp
42 src/Softmax.hpp
43 src/SpaceDepth.hpp
44 src/Split.hpp
45 src/Unpack.hpp
46 src/Transpose.hpp)
47
48add_library(armnnClassicDelegateObject OBJECT ${armnnClassicDelegateObject_sources})
49
50target_include_directories(armnnClassicDelegateObject
51 PUBLIC
52 $<INSTALL_INTERFACE:include>
53 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
54 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include>
55 PRIVATE
56 ${CMAKE_CURRENT_SOURCE_DIR}/src
57 ${PROJECT_SOURCE_DIR}/common/src)
58
59## Add Tflite dependency
60if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH)
61 find_package(TfLiteSrc REQUIRED MODULE)
62endif()
63
64# Various tflite header files are not warning clean
65# We can't change compilation flags on header files directly, so we need to add them to an interface library first
66add_library(tflite_headers INTERFACE)
67target_include_directories(tflite_headers
68 INTERFACE
69 $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}>
70 $<INSTALL_INTERFACE:include/tflite_headers>)
71
72target_compile_options(tflite_headers
73 INTERFACE
74 -Wno-conversion
75 -Wno-sign-conversion
76 -Wno-unused-parameter
77 -Wno-unused-function)
78
79target_link_libraries(armnnClassicDelegateObject PUBLIC tflite_headers)
80
81## Add Flatbuffers dependency
82find_package(Flatbuffers REQUIRED MODULE)
83
84target_link_libraries(armnnClassicDelegateObject PRIVATE ${Flatbuffers_LIB})
85
86# include/flatbuffers/flatbuffers.h is not warning clean
87# We can't change compilation flags on header files directly, so we need to add them to an interface library first
88add_library(flatbuffer_headers INTERFACE)
89target_include_directories(flatbuffer_headers
90 INTERFACE
91 $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}>
92 $<INSTALL_INTERFACE:include/flatbuffer_headers>)
93target_compile_options(flatbuffer_headers INTERFACE -Wno-sign-conversion)
94
95target_link_libraries(armnnClassicDelegateObject PUBLIC flatbuffer_headers)
96
97####################################################
98## Export targets
99install(TARGETS armnnClassicDelegateObject
100 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
101 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})