Skip to content

Commit 23a1386

Browse files
alexreinkingclaude
andauthored
Replace FetchContent in hannk with vcpkg (#8962)
* Use vcpkg to manage hannk dependencies * Resolve the file(GLOB) in hannk * Normalize Python_SITEARCH before passing to find_package vcpkg overrides find_package with a macro that stores \${ARGN} in a double-quoted string. Textual macro substitution causes the value to be re-parsed as a string literal, so a Windows path whose components start with a letter (e.g. \build_bot -> \b) triggers CMake's CMP0010 invalid-escape-sequence error. Normalizing with file(TO_CMAKE_PATH) converts backslashes to forward slashes before the path reaches the macro. No upstream vcpkg issue exists for this as of 2026-02-25. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Improve onnx app portability * apps/onnx: fix narrow random distributions Use MSVC-valid distribution wrappers for bool, int8_t, and uint8_t. N4950 [rand.req.genl]/1.5 does not allow std::uniform_int_distribution on those types. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 49becb9 commit 23a1386

21 files changed

Lines changed: 524 additions & 141 deletions

apps/hannk/CMakeLists.txt

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set(CMAKE_CXX_EXTENSIONS NO)
2929
# (We need to do this even if HANNK_BUILD_TFLITE is off,
3030
# so that the .tflite file parser can get the right schema)
3131
set(TFLITE_VERSION_MAJOR "2" CACHE STRING "Major version of TFLite to assume")
32-
set(TFLITE_VERSION_MINOR "19" CACHE STRING "Minor version of TFLite to assume")
32+
set(TFLITE_VERSION_MINOR "21" CACHE STRING "Minor version of TFLite to assume")
3333
set(TFLITE_VERSION_PATCH "0" CACHE STRING "Patch version of TFLite to assume")
3434
set(TFLITE_VERSION "${TFLITE_VERSION_MAJOR}.${TFLITE_VERSION_MINOR}.${TFLITE_VERSION_PATCH}")
3535

@@ -44,6 +44,14 @@ add_compile_definitions(HANNK_BUILD_TFLITE=$<BOOL:${HANNK_BUILD_TFLITE}>)
4444

4545
# Find HalideHelpers -- this is just the Runtime headers and CMake functions, but no libraries
4646
find_package(HalideHelpers REQUIRED)
47+
if (HANNK_BUILD_TFLITE)
48+
find_package(tensorflow-lite CONFIG REQUIRED)
49+
endif ()
50+
51+
# Canonical include root for hannk headers (e.g. "util/error_util.h").
52+
add_library(hannk_headers INTERFACE)
53+
target_include_directories(hannk_headers INTERFACE
54+
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
4755

4856
# ----------------------------
4957

@@ -107,7 +115,129 @@ if (Halide_TARGET MATCHES "wasm" AND NODE_JS_EXECUTABLE)
107115
endif ()
108116

109117
# Tests
110-
file(GLOB TEST_FILES CONFIGURE_DEPENDS "test/*/*.tflite")
118+
119+
set(TEST_FILES
120+
inception_v2_224_quant/000.DEPTHWISE_CONV_2D.tflite
121+
inception_v4_299_quant/000.CONV_2D.tflite
122+
inception_v4_299_quant/001.CONV_2D.tflite
123+
inception_v4_299_quant/002.CONV_2D.tflite
124+
inception_v4_299_quant/003.MAX_POOL_2D.tflite
125+
inception_v4_299_quant/004.CONV_2D.tflite
126+
inception_v4_299_quant/006.CONV_2D.tflite
127+
inception_v4_299_quant/008.CONV_2D.tflite
128+
inception_v4_299_quant/009.CONV_2D.tflite
129+
inception_v4_299_quant/013.MAX_POOL_2D.tflite
130+
inception_v4_299_quant/015.CONCATENATION.tflite
131+
inception_v4_299_quant/016.AVERAGE_POOL_2D.tflite
132+
inception_v4_299_quant/024.CONCATENATION.tflite
133+
inception_v4_299_quant/044.CONV_2D.tflite
134+
inception_v4_299_quant/045.CONV_2D.tflite
135+
inception_v4_299_quant/049.CONV_2D.tflite
136+
inception_v4_299_quant/052.MAX_POOL_2D.tflite
137+
inception_v4_299_quant/054.CONV_2D.tflite
138+
inception_v4_299_quant/057.CONCATENATION.tflite
139+
inception_v4_299_quant/069.CONCATENATION.tflite
140+
inception_v4_299_quant/081.CONCATENATION.tflite
141+
inception_v4_299_quant/093.CONCATENATION.tflite
142+
inception_v4_299_quant/105.CONCATENATION.tflite
143+
inception_v4_299_quant/117.CONCATENATION.tflite
144+
inception_v4_299_quant/118.AVERAGE_POOL_2D.tflite
145+
inception_v4_299_quant/129.CONCATENATION.tflite
146+
inception_v4_299_quant/140.CONV_2D.tflite
147+
inception_v4_299_quant/141.CONCATENATION.tflite
148+
inception_v4_299_quant/142.MAX_POOL_2D.tflite
149+
inception_v4_299_quant/149.CONCATENATION.tflite
150+
inception_v4_299_quant/178.AVERAGE_POOL_2D.tflite
151+
inception_v4_299_quant/189.CONCATENATION.tflite
152+
inception_v4_299_quant/191.CONCATENATION.tflite
153+
inception_v4_299_quant/192.AVERAGE_POOL_2D.tflite
154+
inception_v4_299_quant/194.SOFTMAX.tflite
155+
misc/L2_NORMALIZATION.tflite
156+
misc/LOGISTIC.tflite
157+
misc/MUL.tflite
158+
misc/SPACE_TO_DEPTH.2.tflite
159+
misc/SPACE_TO_DEPTH.4.tflite
160+
misc/SPLIT.1_1_1.tflite
161+
misc/SPLIT_V.36_5_7.tflite
162+
misc/TRANSPOSE.2_0_1.tflite
163+
misc/bad_broadcast_add.tflite
164+
misc/bad_broadcast_mul.tflite
165+
misc/bad_broadcast_sub.tflite
166+
misc/bad_fully_connected.tflite
167+
mobilenet_v1_0.25_128_quant/000.CONV_2D.tflite
168+
mobilenet_v1_0.25_128_quant/001.DEPTHWISE_CONV_2D.tflite
169+
mobilenet_v1_0.25_128_quant/002.CONV_2D.tflite
170+
mobilenet_v1_0.25_128_quant/003.DEPTHWISE_CONV_2D.tflite
171+
mobilenet_v1_0.25_128_quant/004.CONV_2D.tflite
172+
mobilenet_v1_0.25_128_quant/005.DEPTHWISE_CONV_2D.tflite
173+
mobilenet_v1_0.25_128_quant/006.CONV_2D.tflite
174+
mobilenet_v1_0.25_128_quant/007.DEPTHWISE_CONV_2D.tflite
175+
mobilenet_v1_0.25_128_quant/008.CONV_2D.tflite
176+
mobilenet_v1_0.25_128_quant/009.DEPTHWISE_CONV_2D.tflite
177+
mobilenet_v1_0.25_128_quant/010.CONV_2D.tflite
178+
mobilenet_v1_0.25_128_quant/011.DEPTHWISE_CONV_2D.tflite
179+
mobilenet_v1_0.25_128_quant/012.CONV_2D.tflite
180+
mobilenet_v1_0.25_128_quant/013.DEPTHWISE_CONV_2D.tflite
181+
mobilenet_v1_0.25_128_quant/014.CONV_2D.tflite
182+
mobilenet_v1_0.25_128_quant/019.DEPTHWISE_CONV_2D.tflite
183+
mobilenet_v1_0.25_128_quant/022.CONV_2D.tflite
184+
mobilenet_v1_0.25_128_quant/025.DEPTHWISE_CONV_2D.tflite
185+
mobilenet_v1_0.25_128_quant/027.AVERAGE_POOL_2D.tflite
186+
mobilenet_v1_0.25_128_quant/029.RESHAPE.tflite
187+
mobilenet_v1_0.25_128_quant/030.SOFTMAX.tflite
188+
mobilenet_v1_1.0_224_quant/000.CONV_2D.tflite
189+
mobilenet_v1_1.0_224_quant/001.DEPTHWISE_CONV_2D.tflite
190+
mobilenet_v1_1.0_224_quant/002.CONV_2D.tflite
191+
mobilenet_v1_1.0_224_quant/003.DEPTHWISE_CONV_2D.tflite
192+
mobilenet_v1_1.0_224_quant/004.CONV_2D.tflite
193+
mobilenet_v1_1.0_224_quant/005.DEPTHWISE_CONV_2D.tflite
194+
mobilenet_v1_1.0_224_quant/006.CONV_2D.tflite
195+
mobilenet_v1_1.0_224_quant/007.DEPTHWISE_CONV_2D.tflite
196+
mobilenet_v1_1.0_224_quant/008.CONV_2D.tflite
197+
mobilenet_v1_1.0_224_quant/009.DEPTHWISE_CONV_2D.tflite
198+
mobilenet_v1_1.0_224_quant/013.DEPTHWISE_CONV_2D.tflite
199+
mobilenet_v1_1.0_224_quant/025.DEPTHWISE_CONV_2D.tflite
200+
mobilenet_v1_1.0_224_quant/027.AVERAGE_POOL_2D.tflite
201+
mobilenet_v1_1.0_224_quant/029.RESHAPE.tflite
202+
mobilenet_v1_1.0_224_quant/030.SOFTMAX.tflite
203+
mobilenet_v2_1.0_224_quant/000.CONV_2D.tflite
204+
mobilenet_v2_1.0_224_quant/001.DEPTHWISE_CONV_2D.tflite
205+
mobilenet_v2_1.0_224_quant/002.CONV_2D.tflite
206+
mobilenet_v2_1.0_224_quant/003.CONV_2D.tflite
207+
mobilenet_v2_1.0_224_quant/004.DEPTHWISE_CONV_2D.tflite
208+
mobilenet_v2_1.0_224_quant/005.CONV_2D.tflite
209+
mobilenet_v2_1.0_224_quant/008.CONV_2D.tflite
210+
mobilenet_v2_1.0_224_quant/009.ADD.tflite
211+
mobilenet_v2_1.0_224_quant/012.CONV_2D.tflite
212+
mobilenet_v2_1.0_224_quant/015.CONV_2D.tflite
213+
mobilenet_v2_1.0_224_quant/016.ADD.tflite
214+
mobilenet_v2_1.0_224_quant/020.ADD.tflite
215+
mobilenet_v2_1.0_224_quant/021.CONV_2D.tflite
216+
mobilenet_v2_1.0_224_quant/022.DEPTHWISE_CONV_2D.tflite
217+
mobilenet_v2_1.0_224_quant/023.CONV_2D.tflite
218+
mobilenet_v2_1.0_224_quant/027.ADD.tflite
219+
mobilenet_v2_1.0_224_quant/031.ADD.tflite
220+
mobilenet_v2_1.0_224_quant/032.CONV_2D.tflite
221+
mobilenet_v2_1.0_224_quant/033.DEPTHWISE_CONV_2D.tflite
222+
mobilenet_v2_1.0_224_quant/034.CONV_2D.tflite
223+
mobilenet_v2_1.0_224_quant/035.ADD.tflite
224+
mobilenet_v2_1.0_224_quant/038.CONV_2D.tflite
225+
mobilenet_v2_1.0_224_quant/040.DEPTHWISE_CONV_2D.tflite
226+
mobilenet_v2_1.0_224_quant/042.ADD.tflite
227+
mobilenet_v2_1.0_224_quant/045.CONV_2D.tflite
228+
mobilenet_v2_1.0_224_quant/046.ADD.tflite
229+
mobilenet_v2_1.0_224_quant/047.CONV_2D.tflite
230+
mobilenet_v2_1.0_224_quant/049.CONV_2D.tflite
231+
mobilenet_v2_1.0_224_quant/053.ADD.tflite
232+
mobilenet_v2_1.0_224_quant/054.CONV_2D.tflite
233+
mobilenet_v2_1.0_224_quant/056.CONV_2D.tflite
234+
mobilenet_v2_1.0_224_quant/057.ADD.tflite
235+
mobilenet_v2_1.0_224_quant/059.DEPTHWISE_CONV_2D.tflite
236+
mobilenet_v2_1.0_224_quant/062.AVERAGE_POOL_2D.tflite
237+
mobilenet_v2_1.0_224_quant/064.RESHAPE.tflite
238+
)
239+
list(TRANSFORM TEST_FILES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/test/")
240+
111241
foreach (t IN LISTS TEST_FILES)
112242
file(RELATIVE_PATH test_name ${hannk_SOURCE_DIR} ${t})
113243

apps/hannk/delegate/CMakeLists.txt

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,24 @@
33
add_library(hannk_delegate STATIC
44
hannk_delegate.cpp)
55
target_link_libraries(hannk_delegate PRIVATE
6+
hannk_headers
67
hannk_log_tflite
78
interpreter_lower
8-
tensorflowlite_headers
9+
tensorflow-lite::tensorflow-lite
910
Halide::Runtime)
10-
target_include_directories(hannk_delegate PRIVATE
11-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
1211

1312
# --------------- registrar (static-library) delegate
1413

1514
add_library(hannk_delegate_registrar STATIC
1615
hannk_delegate_provider.cpp)
1716
target_link_libraries(hannk_delegate_registrar PRIVATE
17+
hannk_headers
1818
error_util
1919
interpreter
2020
hannk_delegate
2121
hannk_log_tflite
22-
tensorflowlite_headers
22+
tensorflow-lite::tensorflow-lite
2323
Halide::Runtime)
24-
target_include_directories(hannk_delegate_registrar PRIVATE
25-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
2624

2725

2826
# --------------- external (shared-library) delegate
@@ -33,20 +31,18 @@ target_include_directories(hannk_delegate_registrar PRIVATE
3331
add_library(hannk_delegate_external MODULE
3432
hannk_delegate_adaptor.cpp)
3533
target_link_libraries(hannk_delegate_external PRIVATE
34+
hannk_headers
3635
error_util
3736
interpreter
3837
hannk_delegate
3938
hannk_log_tflite
40-
tensorflowlite_headers
39+
tensorflow-lite::tensorflow-lite
4140
Halide::Runtime)
42-
target_include_directories(hannk_delegate_external PRIVATE
43-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
4441
if (APPLE)
4542
target_link_options(hannk_delegate_external PRIVATE "-Wl,-exported_symbols_list,${hannk_SOURCE_DIR}/delegate/exported_symbols.osx")
4643
else ()
4744
target_link_options(hannk_delegate_external PRIVATE "-Wl,--version-script,${hannk_SOURCE_DIR}/delegate/exported_symbols.ldscript")
48-
endif()
45+
endif ()
4946

5047
# Give it the name that we already use elsewhere ("lib" and ".so" will be added)
5148
set_target_properties(hannk_delegate_external PROPERTIES OUTPUT_NAME "HannkDelegate")
52-

apps/hannk/tflite/CMakeLists.txt

Lines changed: 10 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,12 @@
1-
include(FetchContent)
2-
3-
set(TFLITE_TAG "v${TFLITE_VERSION}")
4-
5-
message(STATUS "Fetching TFLite ${TFLITE_TAG}...")
6-
7-
# static linking makes life with TFLite much easier
8-
set(TFLITE_C_BUILD_SHARED_LIBS OFF)
9-
10-
# We don't care about comparing against these delegates (yet),
11-
# and disabling it reduces compile time meaningfully
12-
set(TFLITE_ENABLE_RUY OFF)
13-
set(TFLITE_ENABLE_XNNPACK OFF)
14-
15-
# Also have to disable some stuff dragged in by TFLite
16-
set(FLATBUFFERS_BUILD_TESTS OFF)
17-
set(FLATBUFFERS_INSTALL OFF)
18-
set(FLATBUFFERS_BUILD_FLATC OFF)
19-
20-
# Enable this to see details about downloading -- useful for debugging
21-
# set(FETCHCONTENT_QUIET NO)
22-
23-
# tflite includes neon2sse transitively, but it's pinned to an old version
24-
# that declares a minimum CMake version of 3.0. We override it here to a
25-
# new enough version that CMake 4+ won't refuse to build it.
26-
FetchContent_Declare(
27-
neon2sse
28-
GIT_REPOSITORY https://github.com/intel/ARM_NEON_2_x86_SSE
29-
GIT_TAG 4732aac1e6c02984a12635d85c4644c2ffe585ca
1+
add_library(tflite_parser STATIC tflite_parser.cpp)
2+
target_sources(
3+
tflite_parser
4+
PUBLIC
5+
FILE_SET HEADERS
6+
FILES tflite_parser.h
307
)
31-
32-
FetchContent_Declare(
33-
tflite
34-
GIT_REPOSITORY https://github.com/tensorflow/tensorflow
35-
GIT_TAG ${TFLITE_TAG}
36-
GIT_SHALLOW TRUE
37-
SOURCE_SUBDIR tensorflow/lite/c
8+
target_link_libraries(
9+
tflite_parser
10+
PUBLIC hannk_headers tensorflow-lite::tensorflow-lite interpreter
11+
PRIVATE Halide::Runtime
3812
)
39-
40-
block(SCOPE_FOR POLICIES VARIABLES)
41-
# Suppress warnings about rotting CMake code we don't control
42-
set(CMAKE_POLICY_DEFAULT_CMP0135 OLD) # DOWNLOAD_EXTRACT_TIMESTAMP
43-
set(CMAKE_POLICY_DEFAULT_CMP0169 OLD) # FetchContent_Populate
44-
set(CMAKE_POLICY_DEFAULT_CMP0177 OLD) # install() path normalization
45-
46-
# Configuration for tflite + upstream deps
47-
set(ABSL_PROPAGATE_CXX_STD ON)
48-
49-
# Suppress warnings in tflite code
50-
add_compile_options(
51-
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-anon-enum-enum-conversion>
52-
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-deprecated-this-capture>
53-
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-shadow-uncaptured-local>
54-
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-shadow>
55-
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-tautological-type-limit-compare>
56-
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-unused-template>
57-
)
58-
59-
FetchContent_MakeAvailable(tflite)
60-
61-
set_property(TARGET tensorflowlite_c PROPERTY EXCLUDE_FROM_ALL TRUE)
62-
endblock()
63-
64-
FetchContent_GetProperties(tflite)
65-
66-
# Make an interface library that is just to get the tflite headers,
67-
# without any implied linkage
68-
add_library(tensorflowlite_headers INTERFACE)
69-
target_include_directories(tensorflowlite_headers INTERFACE
70-
$<BUILD_INTERFACE:${tflite_SOURCE_DIR}>)
71-
72-
# ----------------
73-
add_library(tflite_parser STATIC tflite_parser.cpp)
74-
target_include_directories(tflite_parser
75-
PUBLIC $<BUILD_INTERFACE:${hannk_SOURCE_DIR}>
76-
PRIVATE $<BUILD_INTERFACE:${hannk_BINARY_DIR}>
77-
$<BUILD_INTERFACE:${tflite_SOURCE_DIR}>)
78-
# Ensure that the includes from TFLite's captive flatbuffer library get precedence;
79-
# in case the system may have a too-old version installed.
80-
target_include_directories(tflite_parser BEFORE
81-
PRIVATE $<BUILD_INTERFACE:${FlatBuffers_SOURCE_DIR}/include>)
82-
target_link_libraries(tflite_parser PRIVATE Halide::Runtime)

apps/hannk/util/CMakeLists.txt

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,55 @@
11
add_library(error_util STATIC
22
error_util.cpp)
3-
target_include_directories(error_util PUBLIC
4-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
5-
target_link_libraries(error_util PRIVATE Halide::Runtime)
3+
target_sources(error_util PUBLIC FILE_SET HEADERS FILES error_util.h)
4+
target_link_libraries(error_util PUBLIC hannk_headers
5+
PRIVATE Halide::Runtime)
6+
67

78
add_library(hannk_log_stderr STATIC EXCLUDE_FROM_ALL
89
hannk_log_stderr.cpp)
9-
target_include_directories(hannk_log_stderr PUBLIC
10-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
11-
target_link_libraries(hannk_log_stderr PUBLIC "$<$<PLATFORM_ID:Android>:log>")
10+
target_link_libraries(hannk_log_stderr PUBLIC
11+
hannk_headers
12+
"$<$<PLATFORM_ID:Android>:log>")
13+
1214

1315
add_library(hannk_log_tflite STATIC EXCLUDE_FROM_ALL
1416
hannk_log_tflite.cpp)
15-
target_link_libraries(hannk_log_tflite PRIVATE tensorflowlite_headers)
16-
target_include_directories(hannk_log_tflite PUBLIC
17-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
17+
target_link_libraries(hannk_log_tflite
18+
PRIVATE tensorflow-lite::tensorflow-lite
19+
PUBLIC hannk_headers)
1820

19-
# Sigh, header-only libraries shouldn't be special
2021
add_library(buffer_util INTERFACE)
21-
target_include_directories(buffer_util INTERFACE
22-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
22+
target_sources(buffer_util INTERFACE FILE_SET HEADERS FILES buffer_util.h)
23+
target_link_libraries(buffer_util INTERFACE hannk_headers)
2324

2425
add_library(file_util INTERFACE)
25-
target_include_directories(file_util INTERFACE
26-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
26+
target_sources(file_util INTERFACE FILE_SET HEADERS FILES file_util.h)
27+
target_link_libraries(file_util INTERFACE hannk_headers)
2728

2829
add_library(small_vector INTERFACE)
29-
target_include_directories(small_vector INTERFACE
30-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
30+
target_sources(small_vector INTERFACE FILE_SET HEADERS FILES small_vector.h)
31+
target_link_libraries(small_vector INTERFACE hannk_headers)
3132

3233
add_library(hannk_log_hdr INTERFACE)
33-
target_include_directories(hannk_log_hdr INTERFACE
34-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
34+
target_sources(hannk_log_hdr INTERFACE FILE_SET HEADERS FILES hannk_log_hdr.h)
35+
target_link_libraries(hannk_log_hdr INTERFACE hannk_headers)
3536

3637
add_library(model_runner STATIC
3738
model_runner.cpp)
38-
target_include_directories(model_runner PUBLIC
39-
$<BUILD_INTERFACE:${hannk_SOURCE_DIR}>)
4039
target_compile_definitions(model_runner PRIVATE
41-
-DTFLITE_VERSION_MAJOR=${TFLITE_VERSION_MAJOR}
42-
-DTFLITE_VERSION_MINOR=${TFLITE_VERSION_MINOR}
43-
-DTFLITE_VERSION_PATCH=${TFLITE_VERSION_PATCH})
40+
TFLITE_VERSION_MAJOR=${TFLITE_VERSION_MAJOR}
41+
TFLITE_VERSION_MINOR=${TFLITE_VERSION_MINOR}
42+
TFLITE_VERSION_PATCH=${TFLITE_VERSION_PATCH})
4443
target_link_libraries(model_runner PRIVATE
44+
hannk_headers
4545
interpreter
4646
error_util
4747
file_util
4848
tflite_parser
4949
Halide::Tools # for halide_benchmark.h
50-
Halide::Runtime
51-
tensorflowlite_headers)
52-
50+
Halide::Runtime)
5351
if (HANNK_BUILD_TFLITE)
5452
target_link_libraries(model_runner PRIVATE
55-
tensorflowlite_c
53+
tensorflow-lite::tensorflow-lite
5654
hannk_delegate)
5755
endif ()

apps/onnx/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ if (NOT Python_FOUND)
108108
return()
109109
endif ()
110110

111+
# Normalize to forward slashes before passing to find_package. vcpkg overrides
112+
# find_package with a macro that stores ${ARGN} in a double-quoted string; if
113+
# the path contains a backslash followed by a letter (e.g. \build_bot -> \b),
114+
# CMake treats it as an escape sequence and errors (CMP0010). file(TO_CMAKE_PATH)
115+
# converts native separators to forward slashes, sidestepping the issue on all
116+
# CMake versions.
117+
file(TO_CMAKE_PATH "${Python_SITEARCH}" Python_SITEARCH)
111118
find_package(pybind11 HINTS "${Python_SITEARCH}")
112119
if (NOT pybind11_FOUND)
113120
message(WARNING "Could NOT find pybind11")

0 commit comments

Comments
 (0)