blob: 156f79b0a97ef5404553a35c0e4047457d32c699 [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
John Mcloughlin559d9092023-04-26 20:14:47 +010010 src/ArgMinMax.hpp
Ryan OSheaa37ccb02023-04-11 10:54:07 +010011 src/armnn_delegate.cpp
Kevin May81b66f32023-04-26 14:55:36 +010012 src/BatchSpace.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +010013 src/Convolution.hpp
14 src/Redefine.hpp
15 src/SharedFunctions.cpp
16 src/SharedFunctions.hpp)
Teresa Charlinad1b3d72023-03-14 12:10:28 +000017
18add_library(armnnOpaqueDelegateObject OBJECT ${armnnOpaqueDelegateObject_sources})
19
20target_include_directories(armnnOpaqueDelegateObject
21 PUBLIC
22 $<INSTALL_INTERFACE:include>
23 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
24 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include>
25 PRIVATE
26 ${CMAKE_CURRENT_SOURCE_DIR}/src
27 ${PROJECT_SOURCE_DIR}/common/src)
28
29## Add Tflite dependency
30if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH)
31 find_package(TfLiteSrc REQUIRED MODULE)
32endif()
33
34# Various tflite header files are not warning clean
35# We can't change compilation flags on header files directly, so we need to add them to an interface library first
36add_library(tflite_headers_opaque INTERFACE)
37target_include_directories(tflite_headers_opaque
38 INTERFACE
39 $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}>
40 $<INSTALL_INTERFACE:include/tflite_headers_opaque>)
41
42target_compile_options(tflite_headers_opaque
43 INTERFACE
44 -Wno-conversion
45 -Wno-sign-conversion
46 -Wno-unused-parameter
47 -Wno-unused-function)
48
49target_link_libraries(armnnOpaqueDelegateObject PUBLIC tflite_headers_opaque)
50
51## Add Flatbuffers dependency
52find_package(Flatbuffers REQUIRED MODULE)
53
54target_link_libraries(armnnOpaqueDelegateObject PRIVATE ${Flatbuffers_LIB})
55
56# include/flatbuffers/flatbuffers.h is not warning clean
57# We can't change compilation flags on header files directly, so we need to add them to an interface library first
58add_library(flatbuffer_headers_opaque INTERFACE)
59target_include_directories(flatbuffer_headers_opaque
60 INTERFACE
61 $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}>
62 $<INSTALL_INTERFACE:include/flatbuffer_headers_opaque>)
63target_compile_options(flatbuffer_headers_opaque INTERFACE -Wno-sign-conversion)
64
65target_link_libraries(armnnOpaqueDelegateObject PUBLIC flatbuffer_headers_opaque)
66
67####################################################
68## Export targets
69install(TARGETS armnnOpaqueDelegateObject
70 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
71 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})