File size: 9,721 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# 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})

add_litertlm_library(runtime_components_constrained_decoding_bitmap INTERFACE)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::Bitmap
  ALIAS runtime_components_constrained_decoding_bitmap)

target_include_directories(runtime_components_constrained_decoding_bitmap
  INTERFACE
    ${PKG_ROOT}
    ${LITERTLM_INCLUDE_PATHS}
)

add_litertlm_library(runtime_components_constrained_decoding_constraint INTERFACE)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
  ALIAS runtime_components_constrained_decoding_constraint)

target_include_directories(runtime_components_constrained_decoding_constraint
  INTERFACE
    ${PKG_ROOT}
    ${LITERTLM_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_constraint
  INTERFACE
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Bitmap
    LITERTLM_DEP
)

add_litertlm_library(runtime_components_constrained_decoding_constraint_provider INTERFACE)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::ConstraintProvider
  ALIAS runtime_components_constrained_decoding_constraint_provider)

target_include_directories(runtime_components_constrained_decoding_constraint_provider
  INTERFACE
    ${PKG_ROOT}
    ${LITERTLM_INCLUDE_PATHS}
)


add_litertlm_library(runtime_components_constrained_decoding_constraint_provider_config INTERFACE)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::ConstraintProviderConfig ALIAS runtime_components_constrained_decoding_constraint_provider_config)

target_include_directories(runtime_components_constrained_decoding_constraint_provider_config
  INTERFACE
    ${PKG_ROOT}
    ${LITERTLM_INCLUDE_PATHS}
)

add_litertlm_library(runtime_components_constrained_decoding_constraint_config INTERFACE)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::ConstraintConfig ALIAS runtime_components_constrained_decoding_constraint_config)

target_include_directories(runtime_components_constrained_decoding_constraint_config
  INTERFACE
    ${PKG_ROOT}
    ${LITERTLM_INCLUDE_PATHS}
)

add_litertlm_library(runtime_components_constrained_decoding_fst_constraint INTERFACE)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::FstConstraint ALIAS runtime_components_constrained_decoding_fst_constraint)

target_include_directories(runtime_components_constrained_decoding_fst_constraint
  INTERFACE
    ${PKG_ROOT}
    ${LITERTLM_INCLUDE_PATHS}
)


add_litertlm_library(runtime_components_constrained_decoding_constrained_decoder STATIC
  constrained_decoder.cc
)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::Decoder ALIAS runtime_components_constrained_decoding_constrained_decoder)

target_include_directories(runtime_components_constrained_decoding_constrained_decoder
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
    ${LITERT_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_constrained_decoder
  PUBLIC
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
    LiteRTLM::Runtime::Util::ConvertTensorBuffer
    LiteRTLM::Runtime::Util::LiteRtStatusUtil

    LITERTLM_DEPS
)


add_litertlm_library(runtime_components_constrained_decoding_constraint_provider_factory STATIC
  constraint_provider_factory.cc
)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::Factory ALIAS runtime_components_constrained_decoding_constraint_provider_factory)

target_include_directories(runtime_components_constrained_decoding_constraint_provider_factory
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
    ${LITERT_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_constraint_provider_factory
  PUBLIC
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
    LiteRTLM::Runtime::Util::ConvertTensorBuffer
    LiteRTLM::Runtime::Util::LiteRtStatusUtil

    LITERTLM_DEPS
)


add_litertlm_library(runtime_components_constrained_decoding_external_constraint_provider STATIC
  external_constraint_provider.cc
)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::ExternalProvider ALIAS runtime_components_constrained_decoding_external_constraint_provider)

target_include_directories(runtime_components_constrained_decoding_external_constraint_provider
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
    ${LITERT_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_external_constraint_provider
  PUBLIC
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
    LiteRTLM::Runtime::Util::ConvertTensorBuffer
    LiteRTLM::Runtime::Util::LiteRtStatusUtil

    LITERTLM_DEPS
)



add_litertlm_library(runtime_components_constrained_decoding_fake_constraint STATIC
  fake_constraint.cc
)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::FakeConstraint ALIAS runtime_components_constrained_decoding_fake_constraint)

target_include_directories(runtime_components_constrained_decoding_fake_constraint
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_fake_constraint
  PUBLIC
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Bitmap
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
    LITERTLM_DEPS
)


add_litertlm_library(runtime_components_constrained_decoding_llg_constraint STATIC
  llg_constraint.cc
)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::LlgConstraint ALIAS runtime_components_constrained_decoding_llg_constraint)

target_include_directories(runtime_components_constrained_decoding_llg_constraint
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_llg_constraint
  PUBLIC
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Bitmap
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
    LITERTLM_DEPS
)


add_litertlm_library(runtime_components_constrained_decoding_llg_constraint_provider STATIC
  llg_constraint_provider.cc
)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::LlgConstraintProvider ALIAS runtime_components_constrained_decoding_llg_constraint_provider)

target_include_directories(runtime_components_constrained_decoding_llg_constraint_provider
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_llg_constraint_provider
  PUBLIC
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Bitmap
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
    LITERTLM_DEPS
)


add_litertlm_library(runtime_components_constrained_decoding_llguidance_schema_utils STATIC
  llguidance_schema_utils.cc
)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::LlguidanceSchemaUtils
  ALIAS runtime_components_constrained_decoding_llguidance_schema_utils)

target_include_directories(runtime_components_constrained_decoding_llguidance_schema_utils
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_llguidance_schema_utils
  PUBLIC
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Bitmap
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
    LITERTLM_DEPS
)


add_litertlm_library(runtime_components_constrained_decoding_gemma_model_constraint_provider STATIC
  gemma_model_constraint_provider.cc
)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding::GemmaModelConstraintProvider
  ALIAS runtime_components_constrained_decoding_gemma_model_constraint_provider)

target_include_directories(runtime_components_constrained_decoding_gemma_model_constraint_provider
  PRIVATE
    ${LITERTLM_INCLUDE_PATHS}
    ${LITERT_INCLUDE_PATHS}
)

target_link_libraries(runtime_components_constrained_decoding_gemma_model_constraint_provider
  PUBLIC
    LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
    LiteRTLM::Runtime::Util::ConvertTensorBuffer
    LiteRTLM::Runtime::Util::LiteRtStatusUtil

    LITERTLM_DEPS
)


add_library(runtime_components_constrained_decoding_libs INTERFACE)
add_library(LiteRTLM::Runtime::Components::ConstrainedDecoding
  ALIAS runtime_components_constrained_decoding_libs)

target_link_libraries(runtime_components_constrained_decoding_libs INTERFACE
  LiteRTLM::Runtime::Components::ConstrainedDecoding::Bitmap
  LiteRTLM::Runtime::Components::ConstrainedDecoding::Constraint
  LiteRTLM::Runtime::Components::ConstrainedDecoding::ConstraintProvider
  LiteRTLM::Runtime::Components::ConstrainedDecoding::ConstraintProviderConfig
  LiteRTLM::Runtime::Components::ConstrainedDecoding::ConstraintConfig
  LiteRTLM::Runtime::Components::ConstrainedDecoding::FstConstraint
  LiteRTLM::Runtime::Components::ConstrainedDecoding::GemmaModelConstraintProvider
  LiteRTLM::Runtime::Components::ConstrainedDecoding::Decoder
  LiteRTLM::Runtime::Components::ConstrainedDecoding::ExternalProvider
  LiteRTLM::Runtime::Components::ConstrainedDecoding::Factory
  LiteRTLM::Runtime::Components::ConstrainedDecoding::FakeConstraint
  LiteRTLM::Runtime::Components::ConstrainedDecoding::LlgConstraintProvider
  LiteRTLM::Runtime::Components::ConstrainedDecoding::LlguidanceSchemaUtils
)