File size: 6,813 Bytes
5f923cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Copyright 2026 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


set(PKG_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

# ==============================================================================
# 1. Audio Preprocessor Interface
# ==============================================================================
add_litertlm_library(runtime_components_preprocessor_audio_preprocessor INTERFACE)
add_library(LiteRTLM::Runtime::Components::Preprocessor::Audio ALIAS runtime_components_preprocessor_audio_preprocessor)

target_include_directories(runtime_components_preprocessor_audio_preprocessor
  INTERFACE
    ${LITERTLM_INCLUDE_PATHS}
    ${GENERATED_SRC_DIR}
)

# ==============================================================================
# 2. Audio Preprocessor MiniAudio
# ==============================================================================
add_litertlm_library(runtime_components_preprocessor_audio_preprocessor_miniaudio STATIC
  audio_preprocessor_miniaudio.cc
)
add_library(LiteRTLM::Runtime::Components::Preprocessor::AudioMiniAudio ALIAS runtime_components_preprocessor_audio_preprocessor_miniaudio)

target_include_directories(runtime_components_preprocessor_audio_preprocessor_miniaudio
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
    ${GENERATED_SRC_DIR}
    ${CMAKE_BINARY_DIR}
)

target_link_libraries(runtime_components_preprocessor_audio_preprocessor_miniaudio
  PUBLIC
    LiteRTLM::Runtime::Components::Preprocessor::Audio
    LiteRTLM::Runtime::Components::Preprocessor::MelFilterBank
    runtime_engine_io_types
    runtime_util_litert_status_util
    LITERTLM_DEPS
)

# ==============================================================================
# 3. Bypass Audio Preprocessor
# ==============================================================================
add_litertlm_library(runtime_components_preprocessor_by_pass_audio_preprocessor INTERFACE)
add_library(LiteRTLM::Runtime::Components::Preprocessor::AudioBypass ALIAS runtime_components_preprocessor_by_pass_audio_preprocessor)

target_include_directories(runtime_components_preprocessor_by_pass_audio_preprocessor
  INTERFACE
    ${LITERTLM_INCLUDE_PATHS}
    ${GENERATED_SRC_DIR}
)

# ==============================================================================
# 4. Bypass Image Preprocessor
# ==============================================================================
add_litertlm_library(runtime_components_preprocessor_by_pass_image_preprocessor INTERFACE)
add_library(LiteRTLM::Runtime::Components::Preprocessor::ImageBypass ALIAS runtime_components_preprocessor_by_pass_image_preprocessor)

target_include_directories(runtime_components_preprocessor_by_pass_image_preprocessor
  INTERFACE
    ${LITERTLM_INCLUDE_PATHS}
    ${GENERATED_SRC_DIR}
)

# ==============================================================================
# 5. Image Preprocessor Interface
# ==============================================================================
add_litertlm_library(runtime_components_preprocessor_image_preprocessor INTERFACE)
add_library(LiteRTLM::Runtime::Components::Preprocessor::Image ALIAS runtime_components_preprocessor_image_preprocessor)

target_include_directories(runtime_components_preprocessor_image_preprocessor
  INTERFACE
    ${LITERTLM_INCLUDE_PATHS}
    ${GENERATED_SRC_DIR}
    ${CMAKE_BINARY_DIR}
)

# ==============================================================================
# 6. Mel Filterbank
# ==============================================================================
add_litertlm_library(runtime_components_preprocessor_mel_filterbank STATIC
  mel_filterbank.cc
)
add_library(LiteRTLM::Runtime::Components::Preprocessor::MelFilterBank ALIAS runtime_components_preprocessor_mel_filterbank)

target_include_directories(runtime_components_preprocessor_mel_filterbank
  PUBLIC
    ${LITERTLM_INCLUDE_PATHS}
    ${GENERATED_SRC_DIR}
    ${CMAKE_BINARY_DIR}
)

target_link_libraries(runtime_components_preprocessor_mel_filterbank
  PUBLIC
    LITERTLM_DEPS
)

# ==============================================================================
# 7. Signal Vector Util
# ==============================================================================
add_litertlm_library(runtime_components_preprocessor_signal_vector_util INTERFACE)
add_library(LiteRTLM::Runtime::Components::Preprocessor::SignalVectorUtil ALIAS runtime_components_preprocessor_signal_vector_util)

target_include_directories(runtime_components_preprocessor_signal_vector_util
  INTERFACE
    ${GENERATED_SRC_DIR}
    ${LITERTLM_INCLUDE_PATHS}
)

# ==============================================================================
# 8. STB Image Preprocessor
# ==============================================================================
add_litertlm_library(runtime_components_preprocessor_stb_image_preprocessor STATIC
  stb_image_preprocessor.cc
)
add_library(LiteRTLM::Runtime::Components::Preprocessor::StbImage ALIAS runtime_components_preprocessor_stb_image_preprocessor)

target_include_directories(runtime_components_preprocessor_stb_image_preprocessor
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
    ${GENERATED_SRC_DIR}
    ${CMAKE_BINARY_DIR}
)

target_link_libraries(runtime_components_preprocessor_stb_image_preprocessor
  PUBLIC
    LiteRTLM::Runtime::Components::Preprocessor::Image
    runtime_engine_io_types
    runtime_util_convert_tensor_buffer
    runtime_util_litert_status_util
    LITERTLM_DEPS
    stb_lib
)

# ==============================================================================
# 9. Folder Facade
# ==============================================================================
add_library(runtime_components_preprocessor_libs INTERFACE)
add_library(LiteRTLM::Runtime::Components::Preprocessor ALIAS runtime_components_preprocessor_libs)

target_link_libraries(runtime_components_preprocessor_libs INTERFACE
  LiteRTLM::Runtime::Components::Preprocessor::Audio
  LiteRTLM::Runtime::Components::Preprocessor::AudioMiniAudio
  LiteRTLM::Runtime::Components::Preprocessor::AudioBypass
  LiteRTLM::Runtime::Components::Preprocessor::ImageBypass
  LiteRTLM::Runtime::Components::Preprocessor::Image
  LiteRTLM::Runtime::Components::Preprocessor::MelFilterBank
  LiteRTLM::Runtime::Components::Preprocessor::SignalVectorUtil
  LiteRTLM::Runtime::Components::Preprocessor::StbImage
)