blob: faeabf1832e94a996aee46e19f513dec64c1d55f [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 Monahan6c53f9f2023-04-27 15:21:19 +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
Teresa Charlin86b03572023-04-28 13:19:12 +010040 src/StridedSlice.hpp
Teresa Charlin42362962023-04-28 14:23:33 +010041 src/Transpose.hpp
Teresa Charlinecebb0f2023-04-27 21:37:56 +010042 src/Unpack.hpp)
Teresa Charlinad1b3d72023-03-14 12:10:28 +000043
44add_library(armnnOpaqueDelegateObject OBJECT ${armnnOpaqueDelegateObject_sources})
45
46target_include_directories(armnnOpaqueDelegateObject
47 PUBLIC
48 $<INSTALL_INTERFACE:include>
49 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
50 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include>
51 PRIVATE
52 ${CMAKE_CURRENT_SOURCE_DIR}/src
53 ${PROJECT_SOURCE_DIR}/common/src)
54
55## Add Tflite dependency
56if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH)
57 find_package(TfLiteSrc REQUIRED MODULE)
58endif()
59
60# Various tflite header files are not warning clean
61# We can't change compilation flags on header files directly, so we need to add them to an interface library first
62add_library(tflite_headers_opaque INTERFACE)
63target_include_directories(tflite_headers_opaque
64 INTERFACE
65 $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}>
66 $<INSTALL_INTERFACE:include/tflite_headers_opaque>)
67
68target_compile_options(tflite_headers_opaque
69 INTERFACE
70 -Wno-conversion
71 -Wno-sign-conversion
72 -Wno-unused-parameter
73 -Wno-unused-function)
74
75target_link_libraries(armnnOpaqueDelegateObject PUBLIC tflite_headers_opaque)
76
77## Add Flatbuffers dependency
78find_package(Flatbuffers REQUIRED MODULE)
79
80target_link_libraries(armnnOpaqueDelegateObject PRIVATE ${Flatbuffers_LIB})
81
82# include/flatbuffers/flatbuffers.h is not warning clean
83# We can't change compilation flags on header files directly, so we need to add them to an interface library first
84add_library(flatbuffer_headers_opaque INTERFACE)
85target_include_directories(flatbuffer_headers_opaque
86 INTERFACE
87 $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}>
88 $<INSTALL_INTERFACE:include/flatbuffer_headers_opaque>)
89target_compile_options(flatbuffer_headers_opaque INTERFACE -Wno-sign-conversion)
90
91target_link_libraries(armnnOpaqueDelegateObject PUBLIC flatbuffer_headers_opaque)
92
93####################################################
94## Export targets
95install(TARGETS armnnOpaqueDelegateObject
96 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
David Monahan6c53f9f2023-04-27 15:21:19 +010097 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})