Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright © 2023 Arm Ltd and Contributors. All rights reserved. |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | |
| 6 | set(armnnOpaqueDelegateObject_sources) |
| 7 | list(APPEND armnnOpaqueDelegateObject_sources |
| 8 | include/armnn_delegate.hpp |
Francis Murtagh | c4fb0dd | 2023-03-16 17:01:56 +0000 | [diff] [blame] | 9 | include/Version.hpp |
John Mcloughlin | 559d909 | 2023-04-26 20:14:47 +0100 | [diff] [blame^] | 10 | src/ArgMinMax.hpp |
Ryan OShea | a37ccb0 | 2023-04-11 10:54:07 +0100 | [diff] [blame] | 11 | src/armnn_delegate.cpp |
Kevin May | 81b66f3 | 2023-04-26 14:55:36 +0100 | [diff] [blame] | 12 | src/BatchSpace.hpp |
Matthew Sloyan | 080ffd8 | 2023-04-24 12:53:04 +0100 | [diff] [blame] | 13 | src/Convolution.hpp |
| 14 | src/Redefine.hpp |
| 15 | src/SharedFunctions.cpp |
| 16 | src/SharedFunctions.hpp) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 17 | |
| 18 | add_library(armnnOpaqueDelegateObject OBJECT ${armnnOpaqueDelegateObject_sources}) |
| 19 | |
| 20 | target_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 |
| 30 | if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH) |
| 31 | find_package(TfLiteSrc REQUIRED MODULE) |
| 32 | endif() |
| 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 |
| 36 | add_library(tflite_headers_opaque INTERFACE) |
| 37 | target_include_directories(tflite_headers_opaque |
| 38 | INTERFACE |
| 39 | $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}> |
| 40 | $<INSTALL_INTERFACE:include/tflite_headers_opaque>) |
| 41 | |
| 42 | target_compile_options(tflite_headers_opaque |
| 43 | INTERFACE |
| 44 | -Wno-conversion |
| 45 | -Wno-sign-conversion |
| 46 | -Wno-unused-parameter |
| 47 | -Wno-unused-function) |
| 48 | |
| 49 | target_link_libraries(armnnOpaqueDelegateObject PUBLIC tflite_headers_opaque) |
| 50 | |
| 51 | ## Add Flatbuffers dependency |
| 52 | find_package(Flatbuffers REQUIRED MODULE) |
| 53 | |
| 54 | target_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 |
| 58 | add_library(flatbuffer_headers_opaque INTERFACE) |
| 59 | target_include_directories(flatbuffer_headers_opaque |
| 60 | INTERFACE |
| 61 | $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}> |
| 62 | $<INSTALL_INTERFACE:include/flatbuffer_headers_opaque>) |
| 63 | target_compile_options(flatbuffer_headers_opaque INTERFACE -Wno-sign-conversion) |
| 64 | |
| 65 | target_link_libraries(armnnOpaqueDelegateObject PUBLIC flatbuffer_headers_opaque) |
| 66 | |
| 67 | #################################################### |
| 68 | ## Export targets |
| 69 | install(TARGETS armnnOpaqueDelegateObject |
| 70 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 71 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |