blob: c05bccf8c9e282ddf6b3c8e1dd8fd2b36c3bc3d5 [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(armnnOpaqueDelegateObject_sources)
7list(APPEND armnnOpaqueDelegateObject_sources
8 include/armnn_delegate.hpp
Francis Murtaghc4fb0dd2023-03-16 17:01:56 +00009 include/Version.hpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +010010 src/Activation.hpp
John Mcloughlin559d9092023-04-26 20:14:47 +010011 src/ArgMinMax.hpp
Ryan OSheaa37ccb02023-04-11 10:54:07 +010012 src/armnn_delegate.cpp
Ryan OShea59f8f652023-05-11 20:37:53 +010013 src/armnn_external_delegate.cpp
John Mcloughlin0422cf22023-04-27 16:55:00 +010014 src/BatchMatMul.hpp
Kevin May81b66f32023-04-26 14:55:36 +010015 src/BatchSpace.hpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +010016 src/Comparison.hpp
17 src/Control.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +010018 src/Convolution.hpp
David Monahanc833cef2023-05-03 15:53:03 +010019 src/ElementwiseBinary.hpp
Teresa Charlinf69ae562023-04-27 14:42:23 +010020 src/ElementwiseUnary.hpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +010021 src/FullyConnected.hpp
Kevin Mayb2831c52023-04-26 17:27:24 +010022 src/Gather.hpp
23 src/GatherNd.hpp
Teresa Charlinf69ae562023-04-27 14:42:23 +010024 src/LogicalBinary.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +010025 src/Lstm.hpp
Teresa Charlinf69ae562023-04-27 14:42:23 +010026 src/Normalization.hpp
Teresa Charlinecebb0f2023-04-27 21:37:56 +010027 src/Pad.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +010028 src/Pooling.hpp
Teresa Charlinecebb0f2023-04-27 21:37:56 +010029 src/Pack.hpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +010030 src/Prelu.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +010031 src/Redefine.hpp
John Mcloughlin083586d2023-04-28 18:36:52 +010032 src/Reduce.hpp
33 src/Resize.hpp
Tracy Narine7306bbe2023-07-17 16:06:26 +010034 src/ReverseV2.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +010035 src/Round.hpp
John Mcloughlin0422cf22023-04-27 16:55:00 +010036 src/Shape.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +010037 src/SharedFunctions.cpp
Teresa Charlinecebb0f2023-04-27 21:37:56 +010038 src/SharedFunctions.hpp
Teresa Charlin86b03572023-04-28 13:19:12 +010039 src/Slice.hpp
Teresa Charlin42362962023-04-28 14:23:33 +010040 src/Softmax.hpp
41 src/SpaceDepth.hpp
David Monahanc833cef2023-05-03 15:53:03 +010042 src/Split.hpp
Teresa Charlin86b03572023-04-28 13:19:12 +010043 src/StridedSlice.hpp
Tianle Cheng92ce35c2023-07-25 16:41:00 +010044 src/Tile.hpp
Teresa Charlin42362962023-04-28 14:23:33 +010045 src/Transpose.hpp
Matthew Sloyan74be13e2023-05-03 17:34:00 +010046 src/UnidirectionalSequenceLstm.hpp
Teresa Charlinecebb0f2023-04-27 21:37:56 +010047 src/Unpack.hpp)
Teresa Charlinad1b3d72023-03-14 12:10:28 +000048
49add_library(armnnOpaqueDelegateObject OBJECT ${armnnOpaqueDelegateObject_sources})
50
51target_include_directories(armnnOpaqueDelegateObject
52 PUBLIC
53 $<INSTALL_INTERFACE:include>
54 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
55 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include>
56 PRIVATE
57 ${CMAKE_CURRENT_SOURCE_DIR}/src
58 ${PROJECT_SOURCE_DIR}/common/src)
59
60## Add Tflite dependency
61if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH)
62 find_package(TfLiteSrc REQUIRED MODULE)
63endif()
64
65# Various tflite header files are not warning clean
66# We can't change compilation flags on header files directly, so we need to add them to an interface library first
67add_library(tflite_headers_opaque INTERFACE)
68target_include_directories(tflite_headers_opaque
69 INTERFACE
70 $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}>
71 $<INSTALL_INTERFACE:include/tflite_headers_opaque>)
72
73target_compile_options(tflite_headers_opaque
74 INTERFACE
75 -Wno-conversion
76 -Wno-sign-conversion
77 -Wno-unused-parameter
78 -Wno-unused-function)
79
80target_link_libraries(armnnOpaqueDelegateObject PUBLIC tflite_headers_opaque)
81
82## Add Flatbuffers dependency
83find_package(Flatbuffers REQUIRED MODULE)
84
85target_link_libraries(armnnOpaqueDelegateObject PRIVATE ${Flatbuffers_LIB})
86
87# include/flatbuffers/flatbuffers.h is not warning clean
88# We can't change compilation flags on header files directly, so we need to add them to an interface library first
89add_library(flatbuffer_headers_opaque INTERFACE)
90target_include_directories(flatbuffer_headers_opaque
91 INTERFACE
92 $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}>
93 $<INSTALL_INTERFACE:include/flatbuffer_headers_opaque>)
94target_compile_options(flatbuffer_headers_opaque INTERFACE -Wno-sign-conversion)
95
96target_link_libraries(armnnOpaqueDelegateObject PUBLIC flatbuffer_headers_opaque)
97
Narumol Prangnawarat26654cb2023-05-03 16:08:11 +010098# Additional Absl Sync for Opaque Delegate
99find_package(TfLiteAbsl REQUIRED MODULE)
100target_include_directories(armnnOpaqueDelegateObject PUBLIC ${TfLite_ABSL_SYNC_HEADERS})
101target_link_libraries(armnnOpaqueDelegateObject PUBLIC ${TfLite_Extra_Absl_LIB})
102
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000103####################################################
104## Export targets
105install(TARGETS armnnOpaqueDelegateObject
106 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
David Monahan6c53f9f2023-04-27 15:21:19 +0100107 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})