-
Notifications
You must be signed in to change notification settings - Fork 528
/
Copy pathCMakeLists.txt
49 lines (44 loc) · 1.63 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#[[
/*
* Copyright (c) 2024 MediaTek Inc.
*
* Licensed under the BSD License (the "License"); you may not use this file
* except in compliance with the License. See the license file in the root
* directory of this source tree for more details.
*/
]]
# Let include directory as "executorch/..."
set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
set(NEURON_BUFFER_ALLOCATOR_LIB
""
CACHE PATH "Path to Neuron Buffer Allocator library"
)
message(
STATUS "Looking for neuron_buffer_allocator in ${NEURON_BUFFER_ALLOCATOR_LIB}"
)
include_directories(BEFORE ${_common_include_directories})
# shortcut include directory for neuron headers
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/include)
# targets
add_library(neuron_backend SHARED)
target_compile_options(neuron_backend PRIVATE "-frtti" "-fexceptions")
target_link_libraries(neuron_backend
PRIVATE
executorch_core
android
log
${NEURON_BUFFER_ALLOCATOR_LIB}
)
target_sources(
neuron_backend
INTERFACE ${CMAKE_CURRENT_LIST_DIR}/runtime/include/NeuronBackend.h
${CMAKE_CURRENT_LIST_DIR}/runtime/include/NeuronBufferAllocator.h
${CMAKE_CURRENT_LIST_DIR}/runtime/include/NeuronExecutor.h
${CMAKE_CURRENT_LIST_DIR}/runtime/include/NeuronLog.h
${CMAKE_CURRENT_LIST_DIR}/runtime/include/api/APUWareUtilsLib.h
${CMAKE_CURRENT_LIST_DIR}/runtime/include/api/NeuronAdapterShim.h
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/runtime/NeuronBackend.cpp
${CMAKE_CURRENT_LIST_DIR}/runtime/NeuronExecutor.cpp
)
target_link_options_shared_lib(neuron_backend)
install(TARGETS neuron_backend DESTINATION lib)