blob: f1c88513963df0e6baaca8a2943639bc3e9f235b [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
Teresa Charlinf69ae562023-04-27 14:42:23 +010018 src/ElementwiseUnary.hpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +010019 src/FullyConnected.hpp
Kevin Mayb2831c52023-04-26 17:27:24 +010020 src/Gather.hpp
21 src/GatherNd.hpp
Teresa Charlinf69ae562023-04-27 14:42:23 +010022 src/LogicalBinary.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +010023 src/Lstm.hpp
Teresa Charlinf69ae562023-04-27 14:42:23 +010024 src/Normalization.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +010025 src/Pooling.hpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +010026 src/Prelu.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +010027 src/Redefine.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +010028 src/Round.hpp
John Mcloughlin0422cf22023-04-27 16:55:00 +010029 src/Shape.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +010030 src/SharedFunctions.cpp
31 src/SharedFunctions.hpp)
Teresa Charlinad1b3d72023-03-14 12:10:28 +000032
33add_library(armnnOpaqueDelegateObject OBJECT ${armnnOpaqueDelegateObject_sources})
34
35target_include_directories(armnnOpaqueDelegateObject
36 PUBLIC
37 $<INSTALL_INTERFACE:include>
38 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
39 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include>
40 PRIVATE
41 ${CMAKE_CURRENT_SOURCE_DIR}/src
42 ${PROJECT_SOURCE_DIR}/common/src)
43
44## Add Tflite dependency
45if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH)
46 find_package(TfLiteSrc REQUIRED MODULE)
47endif()
48
49# Various tflite header files are not warning clean
50# We can't change compilation flags on header files directly, so we need to add them to an interface library first
51add_library(tflite_headers_opaque INTERFACE)
52target_include_directories(tflite_headers_opaque
53 INTERFACE
54 $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}>
55 $<INSTALL_INTERFACE:include/tflite_headers_opaque>)
56
57target_compile_options(tflite_headers_opaque
58 INTERFACE
59 -Wno-conversion
60 -Wno-sign-conversion
61 -Wno-unused-parameter
62 -Wno-unused-function)
63
64target_link_libraries(armnnOpaqueDelegateObject PUBLIC tflite_headers_opaque)
65
66## Add Flatbuffers dependency
67find_package(Flatbuffers REQUIRED MODULE)
68
69target_link_libraries(armnnOpaqueDelegateObject PRIVATE ${Flatbuffers_LIB})
70
71# include/flatbuffers/flatbuffers.h is not warning clean
72# We can't change compilation flags on header files directly, so we need to add them to an interface library first
73add_library(flatbuffer_headers_opaque INTERFACE)
74target_include_directories(flatbuffer_headers_opaque
75 INTERFACE
76 $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}>
77 $<INSTALL_INTERFACE:include/flatbuffer_headers_opaque>)
78target_compile_options(flatbuffer_headers_opaque INTERFACE -Wno-sign-conversion)
79
80target_link_libraries(armnnOpaqueDelegateObject PUBLIC flatbuffer_headers_opaque)
81
82####################################################
83## Export targets
84install(TARGETS armnnOpaqueDelegateObject
85 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
86 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})