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