Fix crash on iOS due to symbol resolution. (#4162)

Fixes #2588
This commit is contained in:
Fangjun Kuang authored and GitHub committed 2026-11-06 10:37:03 +08:00
1 parent 079a6f05d0
commit ed0e4b171e
17 files changed
+91 -57

No files matched your search

+2 -3
View File
@@ -1,8 +1,9 @@
include_guard(GLOBAL)
function(download_asio) function(download_asio)
include(FetchContent) include(FetchContent)
set(asio_URL "https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-24-0.tar.gz") set(asio_URL "https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-24-0.tar.gz")
set(asio_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/asio-asio-1-24-0.tar.gz")
set(asio_HASH "SHA256=cbcaaba0f66722787b1a7c33afe1befb3a012b5af3ad7da7ff0f6b8c9b7a8a5b") set(asio_HASH "SHA256=cbcaaba0f66722787b1a7c33afe1befb3a012b5af3ad7da7ff0f6b8c9b7a8a5b")
# If you don't have access to the Internet, # If you don't have access to the Internet,
@@ -20,7 +21,6 @@ function(download_asio)
set(asio_URL "${f}") set(asio_URL "${f}")
file(TO_CMAKE_PATH "${asio_URL}" asio_URL) file(TO_CMAKE_PATH "${asio_URL}" asio_URL)
message(STATUS "Found local downloaded asio: ${asio_URL}") message(STATUS "Found local downloaded asio: ${asio_URL}")
set(asio_URL2)
break() break()
endif() endif()
endforeach() endforeach()
@@ -28,7 +28,6 @@ function(download_asio)
FetchContent_Declare(asio FetchContent_Declare(asio
URL URL
${asio_URL} ${asio_URL}
${asio_URL2}
URL_HASH ${asio_HASH} URL_HASH ${asio_HASH}
) )
+9 -25
View File
@@ -71,13 +71,12 @@ def get_cmake_dir():
def get_hardcoded_deps(): def get_hardcoded_deps():
"""Return deps that don't have a cmake file (e.g., kaldifst). """Return deps that don't have a cmake file (e.g., kaldifst).
Returns list of (name, url, url2, sha256). Returns list of (name, url, sha256).
""" """
return [ return [
( (
"kaldifst", "kaldifst",
"https://github.com/k2-fsa/kaldifst/archive/refs/tags/v1.8.0.tar.gz", "https://github.com/k2-fsa/kaldifst/archive/refs/tags/v1.8.0.tar.gz",
"",
"3f247b7e5a2409071202f5e2bc6200060f66728c0a3443c03923ad2723e040b3", "3f247b7e5a2409071202f5e2bc6200060f66728c0a3443c03923ad2723e040b3",
), ),
] ]
@@ -86,22 +85,18 @@ def get_hardcoded_deps():
def parse_url_and_hash(filepath): def parse_url_and_hash(filepath):
"""Parse a cmake file for URL and SHA256 hash pairs. """Parse a cmake file for URL and SHA256 hash pairs.
Returns a list of (name, url, url2, sha256) tuples. Returns a list of (name, url, sha256) tuples.
""" """
text = filepath.read_text() text = filepath.read_text()
deps = [] deps = []
# Pattern: set(name_URL "https://...") # Pattern: set(name_URL "https://...")
# set(name_URL2 "https://...") (optional)
# set(name_HASH "SHA256=...") # set(name_HASH "SHA256=...")
# Use [\w-]+ to match names with hyphens (e.g., simple-sentencepiece) # Use [\w-]+ to match names with hyphens (e.g., simple-sentencepiece)
name_re = r'([\w-]+?)' name_re = r'([\w-]+?)'
url_pattern = re.compile( url_pattern = re.compile(
rf'set\({name_re}_URL\s+"([^"]+)"\)', re.MULTILINE rf'set\({name_re}_URL\s+"([^"]+)"\)', re.MULTILINE
) )
url2_pattern = re.compile(
rf'set\({name_re}_URL2\s+"([^"]+)"\)', re.MULTILINE
)
hash_pattern = re.compile( hash_pattern = re.compile(
rf'set\({name_re}_HASH\s+"SHA256=([^"]+)"\)', re.MULTILINE rf'set\({name_re}_HASH\s+"SHA256=([^"]+)"\)', re.MULTILINE
) )
@@ -113,14 +108,12 @@ def parse_url_and_hash(filepath):
if "${" not in url and name not in urls: if "${" not in url and name not in urls:
urls[name] = url urls[name] = url
url2s = {m.group(1): m.group(2) for m in url2_pattern.finditer(text)}
hashes = {m.group(1): m.group(2) for m in hash_pattern.finditer(text)} hashes = {m.group(1): m.group(2) for m in hash_pattern.finditer(text)}
for name, url in urls.items(): for name, url in urls.items():
sha256 = hashes.get(name, "") sha256 = hashes.get(name, "")
url2 = url2s.get(name, "")
if sha256: if sha256:
deps.append((name, url, url2, sha256)) deps.append((name, url, sha256))
return deps return deps
@@ -170,7 +163,7 @@ def parse_windows_onnxruntime(filepath, crt, build_type):
def discover_common_deps(cmake_dir): def discover_common_deps(cmake_dir):
"""Discover platform-independent deps from cmake files. """Discover platform-independent deps from cmake files.
Returns list of (name, url, url2, sha256). Returns list of (name, url, sha256).
""" """
# These cmake files contain platform-independent deps # These cmake files contain platform-independent deps
dep_files = [ dep_files = [
@@ -230,7 +223,7 @@ def ask_yes_no(question, default="y"):
def select_onnxruntime_deps(cmake_dir): def select_onnxruntime_deps(cmake_dir):
"""Interactively select onnxruntime deps based on platform. """Interactively select onnxruntime deps based on platform.
Returns list of (name, url, url2, sha256). Returns list of (name, url, sha256).
""" """
os_choice = select_menu( os_choice = select_menu(
"Select target OS:", "Select target OS:",
@@ -389,17 +382,14 @@ def parse_aarch64_gpu_deps(path):
# Check for URL override in this block # Check for URL override in this block
url_m = re.search(r'set\(onnxruntime_URL\s+"(https://[^"]+)"\)', block) url_m = re.search(r'set\(onnxruntime_URL\s+"(https://[^"]+)"\)', block)
url2_m = re.search(r'set\(onnxruntime_URL2\s+"(https://[^"]+)"\)', block)
if url_m: if url_m:
url = url_m.group(1) url = url_m.group(1)
url2 = url2_m.group(1) if url2_m else ""
else: else:
# Use template # Use template
url = url_template.format(v=version) url = url_template.format(v=version)
url2 = ""
deps.append(("onnxruntime", url, url2, sha256)) deps.append(("onnxruntime", url, sha256))
return deps return deps
@@ -524,7 +514,7 @@ def main():
# Discover common deps # Discover common deps
common_deps = get_hardcoded_deps() + discover_common_deps(cmake_dir) common_deps = get_hardcoded_deps() + discover_common_deps(cmake_dir)
print(f"\nFound {len(common_deps)} common (platform-independent) dependencies:") print(f"\nFound {len(common_deps)} common (platform-independent) dependencies:")
for name, url, url2, sha256 in common_deps: for name, url, sha256 in common_deps:
print(f" {name}: {filename_from_url(url, name, cmake_dir)}") print(f" {name}: {filename_from_url(url, name, cmake_dir)}")
# Ask about onnxruntime # Ask about onnxruntime
@@ -533,7 +523,7 @@ def main():
ort_deps = select_onnxruntime_deps(cmake_dir) ort_deps = select_onnxruntime_deps(cmake_dir)
if ort_deps: if ort_deps:
print(f"\nSelected {len(ort_deps)} onnxruntime file(s):") print(f"\nSelected {len(ort_deps)} onnxruntime file(s):")
for name, url, url2, sha256 in ort_deps: for name, url, sha256 in ort_deps:
print(f" {name}: {filename_from_url(url, name, cmake_dir)}") print(f" {name}: {filename_from_url(url, name, cmake_dir)}")
else: else:
print("\nSkipping onnxruntime download.") print("\nSkipping onnxruntime download.")
@@ -560,18 +550,12 @@ def main():
print(f"\nDownloading {len(all_deps)} file(s) to {dl_path}...") print(f"\nDownloading {len(all_deps)} file(s) to {dl_path}...")
downloaded = [] downloaded = []
failed = [] failed = []
for name, url, url2, sha256 in all_deps: for name, url, sha256 in all_deps:
fname = filename_from_url(url, name, cmake_dir) fname = filename_from_url(url, name, cmake_dir)
filepath = dl_path / fname filepath = dl_path / fname
if download_file(url, filepath, sha256): if download_file(url, filepath, sha256):
downloaded.append(fname) downloaded.append(fname)
else: else:
# Try mirror URL
if url2:
print(f" Trying mirror: {url2}")
if download_file(url2, filepath, sha256):
downloaded.append(fname)
continue
failed.append(fname) failed.append(fname)
# Summary # Summary
+2
View File
@@ -1,3 +1,5 @@
include_guard(GLOBAL)
function(download_eigen) function(download_eigen)
include(FetchContent) include(FetchContent)
+2 -3
View File
@@ -1,8 +1,9 @@
include_guard(GLOBAL)
function(download_googltest) function(download_googltest)
include(FetchContent) include(FetchContent)
set(googletest_URL "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz") set(googletest_URL "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz")
set(googletest_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/googletest-1.13.0.tar.gz")
set(googletest_HASH "SHA256=ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363") set(googletest_HASH "SHA256=ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363")
# If you don't have access to the Internet, # If you don't have access to the Internet,
@@ -20,7 +21,6 @@ function(download_googltest)
set(googletest_URL "${f}") set(googletest_URL "${f}")
file(TO_CMAKE_PATH "${googletest_URL}" googletest_URL) file(TO_CMAKE_PATH "${googletest_URL}" googletest_URL)
message(STATUS "Found local downloaded googletest: ${googletest_URL}") message(STATUS "Found local downloaded googletest: ${googletest_URL}")
set(googletest_URL2)
break() break()
endif() endif()
endforeach() endforeach()
@@ -33,7 +33,6 @@ function(download_googltest)
FetchContent_Declare(googletest FetchContent_Declare(googletest
URL URL
${googletest_URL} ${googletest_URL}
${googletest_URL2}
URL_HASH ${googletest_HASH} URL_HASH ${googletest_HASH}
) )
+2 -3
View File
@@ -1,9 +1,10 @@
include_guard(GLOBAL)
function(download_hclust_cpp) function(download_hclust_cpp)
include(FetchContent) include(FetchContent)
# The latest release as of 2026.02.25 # The latest release as of 2026.02.25
set(hclust_cpp_URL "https://github.com/csukuangfj/hclust-cpp/archive/refs/tags/2026-02-25.tar.gz") set(hclust_cpp_URL "https://github.com/csukuangfj/hclust-cpp/archive/refs/tags/2026-02-25.tar.gz")
set(hclust_cpp_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/hclust-cpp-2026-02-25.tar.gz")
set(hclust_cpp_HASH "SHA256=8f14e024c709d73afb40ae69cb22de4b73dba67cbce40f2e518813da8139ab56") set(hclust_cpp_HASH "SHA256=8f14e024c709d73afb40ae69cb22de4b73dba67cbce40f2e518813da8139ab56")
# If you don't have access to the Internet, # If you don't have access to the Internet,
@@ -21,7 +22,6 @@ function(download_hclust_cpp)
set(hclust_cpp_URL "${f}") set(hclust_cpp_URL "${f}")
file(TO_CMAKE_PATH "${hclust_cpp_URL}" hclust_cpp_URL) file(TO_CMAKE_PATH "${hclust_cpp_URL}" hclust_cpp_URL)
message(STATUS "Found local downloaded hclust_cpp: ${hclust_cpp_URL}") message(STATUS "Found local downloaded hclust_cpp: ${hclust_cpp_URL}")
set(hclust_cpp_URL2)
break() break()
endif() endif()
endforeach() endforeach()
@@ -29,7 +29,6 @@ function(download_hclust_cpp)
FetchContent_Declare(hclust_cpp FetchContent_Declare(hclust_cpp
URL URL
${hclust_cpp_URL} ${hclust_cpp_URL}
${hclust_cpp_URL2}
URL_HASH ${hclust_cpp_HASH} URL_HASH ${hclust_cpp_HASH}
) )
+3 -3
View File
@@ -1,8 +1,9 @@
include_guard(GLOBAL)
function(download_json) function(download_json)
include(FetchContent) include(FetchContent)
set(json_URL "https://github.com/nlohmann/json/archive/refs/tags/v3.12.0.tar.gz") set(json_URL "https://github.com/nlohmann/json/archive/refs/tags/v3.12.0.tar.gz")
set(json_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/json-3.12.0.tar.gz")
set(json_HASH "SHA256=4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187") set(json_HASH "SHA256=4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187")
# If you don't have access to the Internet, # If you don't have access to the Internet,
@@ -20,13 +21,12 @@ function(download_json)
set(json_URL "${f}") set(json_URL "${f}")
file(TO_CMAKE_PATH "${json_URL}" json_URL) file(TO_CMAKE_PATH "${json_URL}" json_URL)
message(STATUS "Found local downloaded json: ${json_URL}") message(STATUS "Found local downloaded json: ${json_URL}")
set(json_URL2)
break() break()
endif() endif()
endforeach() endforeach()
FetchContent_Declare(json FetchContent_Declare(json
URL ${json_URL} ${json_URL2} URL ${json_URL}
URL_HASH ${json_HASH} URL_HASH ${json_HASH}
) )
+2
View File
@@ -1,3 +1,5 @@
include_guard(GLOBAL)
function(download_kaldi_decoder) function(download_kaldi_decoder)
include(FetchContent) include(FetchContent)
+9 -7
View File
@@ -1,8 +1,10 @@
include_guard(GLOBAL)
function(download_kaldi_native_fbank) function(download_kaldi_native_fbank)
include(FetchContent) include(FetchContent)
set(kaldi_native_fbank_URL "https://github.com/csukuangfj/kaldi-native-fbank/archive/refs/tags/v1.22.4.tar.gz") set(kaldi_native_fbank_URL "https://github.com/csukuangfj/kaldi-native-fbank/archive/refs/tags/v1.23.0.tar.gz")
set(kaldi_native_fbank_HASH "SHA256=257fea639585ca6ee00860493bb9d7ab32488b8a5407ffe434c1f361ea545fae") set(kaldi_native_fbank_HASH "SHA256=97e75ad01f486c45d6b0169a305e1e057f660fe84eb65db1aab773b732335062")
set(KALDI_NATIVE_FBANK_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(KALDI_NATIVE_FBANK_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(KALDI_NATIVE_FBANK_BUILD_PYTHON OFF CACHE BOOL "" FORCE) set(KALDI_NATIVE_FBANK_BUILD_PYTHON OFF CACHE BOOL "" FORCE)
@@ -11,11 +13,11 @@ function(download_kaldi_native_fbank)
# If you don't have access to the Internet, # If you don't have access to the Internet,
# please pre-download kaldi-native-fbank # please pre-download kaldi-native-fbank
set(possible_file_locations set(possible_file_locations
$ENV{HOME}/Downloads/kaldi-native-fbank-1.22.4.tar.gz $ENV{HOME}/Downloads/kaldi-native-fbank-1.23.0.tar.gz
${CMAKE_SOURCE_DIR}/kaldi-native-fbank-1.22.4.tar.gz ${CMAKE_SOURCE_DIR}/kaldi-native-fbank-1.23.0.tar.gz
${CMAKE_BINARY_DIR}/kaldi-native-fbank-1.22.4.tar.gz ${CMAKE_BINARY_DIR}/kaldi-native-fbank-1.23.0.tar.gz
/tmp/kaldi-native-fbank-1.22.4.tar.gz /tmp/kaldi-native-fbank-1.23.0.tar.gz
/star-fj/fangjun/download/github/kaldi-native-fbank-1.22.4.tar.gz /star-fj/fangjun/download/github/kaldi-native-fbank-1.23.0.tar.gz
) )
foreach(f IN LISTS possible_file_locations) foreach(f IN LISTS possible_file_locations)
+2
View File
@@ -1,3 +1,5 @@
include_guard(GLOBAL)
# Copyright (c) 2022-2023 Xiaomi Corporation # Copyright (c) 2022-2023 Xiaomi Corporation
function(download_onnxruntime) function(download_onnxruntime)
include(FetchContent) include(FetchContent)
+2
View File
@@ -1,3 +1,5 @@
include_guard(GLOBAL)
# Copyright (c) 2020 Xiaomi Corporation (author: Fangjun Kuang) # Copyright (c) 2020 Xiaomi Corporation (author: Fangjun Kuang)
function(download_openfst) function(download_openfst)
+2 -3
View File
@@ -1,8 +1,9 @@
include_guard(GLOBAL)
function(download_portaudio) function(download_portaudio)
include(FetchContent) include(FetchContent)
set(portaudio_URL "http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz") set(portaudio_URL "http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz")
set(portaudio_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/pa_stable_v190700_20210406.tgz")
set(portaudio_HASH "SHA256=47efbf42c77c19a05d22e627d42873e991ec0c1357219c0d74ce6a2948cb2def") set(portaudio_HASH "SHA256=47efbf42c77c19a05d22e627d42873e991ec0c1357219c0d74ce6a2948cb2def")
# If you don't have access to the Internet, please download it to your # If you don't have access to the Internet, please download it to your
@@ -21,7 +22,6 @@ function(download_portaudio)
set(portaudio_URL "${f}") set(portaudio_URL "${f}")
file(TO_CMAKE_PATH "${portaudio_URL}" portaudio_URL) file(TO_CMAKE_PATH "${portaudio_URL}" portaudio_URL)
message(STATUS "Found local downloaded portaudio: ${portaudio_URL}") message(STATUS "Found local downloaded portaudio: ${portaudio_URL}")
set(portaudio_URL2)
break() break()
endif() endif()
endforeach() endforeach()
@@ -35,7 +35,6 @@ function(download_portaudio)
FetchContent_Declare(portaudio FetchContent_Declare(portaudio
URL URL
${portaudio_URL} ${portaudio_URL}
${portaudio_URL2}
URL_HASH ${portaudio_HASH} URL_HASH ${portaudio_HASH}
) )
+2 -3
View File
@@ -1,8 +1,9 @@
include_guard(GLOBAL)
function(download_pybind11) function(download_pybind11)
include(FetchContent) include(FetchContent)
set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v3.0.0.tar.gz") set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v3.0.0.tar.gz")
set(pybind11_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/pybind11-3.0.0.tar.gz")
set(pybind11_HASH "SHA256=453b1a3e2b266c3ae9da872411cadb6d693ac18063bd73226d96cfb7015a200c") set(pybind11_HASH "SHA256=453b1a3e2b266c3ae9da872411cadb6d693ac18063bd73226d96cfb7015a200c")
# If you don't have access to the Internet, # If you don't have access to the Internet,
@@ -20,7 +21,6 @@ function(download_pybind11)
set(pybind11_URL "${f}") set(pybind11_URL "${f}")
file(TO_CMAKE_PATH "${pybind11_URL}" pybind11_URL) file(TO_CMAKE_PATH "${pybind11_URL}" pybind11_URL)
message(STATUS "Found local downloaded pybind11: ${pybind11_URL}") message(STATUS "Found local downloaded pybind11: ${pybind11_URL}")
set(pybind11_URL2)
break() break()
endif() endif()
endforeach() endforeach()
@@ -28,7 +28,6 @@ function(download_pybind11)
FetchContent_Declare(pybind11 FetchContent_Declare(pybind11
URL URL
${pybind11_URL} ${pybind11_URL}
${pybind11_URL2}
URL_HASH ${pybind11_HASH} URL_HASH ${pybind11_HASH}
) )
+2 -3
View File
@@ -1,3 +1,5 @@
include_guard(GLOBAL)
# Write ${content} to ${path} only when it differs from what is on disk. # Write ${content} to ${path} only when it differs from what is on disk.
# The patches below run on every configure; a plain file(WRITE) would update # The patches below run on every configure; a plain file(WRITE) would update
# the header's mtime each time and make/ssentencepiece (plus every dependent # the header's mtime each time and make/ssentencepiece (plus every dependent
@@ -18,7 +20,6 @@ function(download_simple_sentencepiece)
include(FetchContent) include(FetchContent)
set(simple-sentencepiece_URL "https://github.com/pkufool/simple-sentencepiece/archive/refs/tags/v0.7.tar.gz") set(simple-sentencepiece_URL "https://github.com/pkufool/simple-sentencepiece/archive/refs/tags/v0.7.tar.gz")
set(simple-sentencepiece_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/simple-sentencepiece-0.7.tar.gz")
set(simple-sentencepiece_HASH "SHA256=1748a822060a35baa9f6609f84efc8eb54dc0e74b9ece3d82367b7119fdc75af") set(simple-sentencepiece_HASH "SHA256=1748a822060a35baa9f6609f84efc8eb54dc0e74b9ece3d82367b7119fdc75af")
# If you don't have access to the Internet, # If you don't have access to the Internet,
@@ -36,7 +37,6 @@ function(download_simple_sentencepiece)
set(simple-sentencepiece_URL "${f}") set(simple-sentencepiece_URL "${f}")
file(TO_CMAKE_PATH "${simple-sentencepiece_URL}" simple-sentencepiece_URL) file(TO_CMAKE_PATH "${simple-sentencepiece_URL}" simple-sentencepiece_URL)
message(STATUS "Found local downloaded simple-sentencepiece: ${simple-sentencepiece_URL}") message(STATUS "Found local downloaded simple-sentencepiece: ${simple-sentencepiece_URL}")
set(simple-sentencepiece_URL2)
break() break()
endif() endif()
endforeach() endforeach()
@@ -47,7 +47,6 @@ function(download_simple_sentencepiece)
FetchContent_Declare(simple-sentencepiece FetchContent_Declare(simple-sentencepiece
URL URL
${simple-sentencepiece_URL} ${simple-sentencepiece_URL}
${simple-sentencepiece_URL2}
URL_HASH URL_HASH
${simple-sentencepiece_HASH} ${simple-sentencepiece_HASH}
) )
+44
View File
@@ -1,3 +1,5 @@
include_guard(GLOBAL)
function(download_utf8proc) function(download_utf8proc)
include(FetchContent) include(FetchContent)
@@ -49,6 +51,48 @@ function(download_utf8proc)
add_subdirectory(${utf8proc_SOURCE_DIR} ${utf8proc_BINARY_DIR} EXCLUDE_FROM_ALL) add_subdirectory(${utf8proc_SOURCE_DIR} ${utf8proc_BINARY_DIR} EXCLUDE_FROM_ALL)
# utf8proc's C symbols (utf8proc_map, utf8proc_free, ...) are generic enough
# that the host application may link its own copy of utf8proc (text libraries
# commonly bundle it). Merging two copies makes the linker bind our calls to
# the foreign one; if the two versions disagree (e.g. utf8proc_property_t
# layout), that corrupts memory at runtime — the same failure mode as the
# kissfft clash in https://github.com/k2-fsa/sherpa-onnx/issues/2588.
# Rename every public C symbol of utf8proc with a sherpa_onnx_ prefix. PUBLIC
# is required so our own sources see the renamed declarations.
target_compile_definitions(utf8proc PUBLIC
utf8proc_category=sherpa_onnx_utf8proc_category
utf8proc_category_string=sherpa_onnx_utf8proc_category_string
utf8proc_charwidth=sherpa_onnx_utf8proc_charwidth
utf8proc_charwidth_ambiguous=sherpa_onnx_utf8proc_charwidth_ambiguous
utf8proc_codepoint_valid=sherpa_onnx_utf8proc_codepoint_valid
utf8proc_decompose=sherpa_onnx_utf8proc_decompose
utf8proc_decompose_char=sherpa_onnx_utf8proc_decompose_char
utf8proc_decompose_custom=sherpa_onnx_utf8proc_decompose_custom
utf8proc_encode_char=sherpa_onnx_utf8proc_encode_char
utf8proc_errmsg=sherpa_onnx_utf8proc_errmsg
utf8proc_free=sherpa_onnx_utf8proc_free
utf8proc_get_property=sherpa_onnx_utf8proc_get_property
utf8proc_grapheme_break=sherpa_onnx_utf8proc_grapheme_break
utf8proc_grapheme_break_stateful=sherpa_onnx_utf8proc_grapheme_break_stateful
utf8proc_islower=sherpa_onnx_utf8proc_islower
utf8proc_isupper=sherpa_onnx_utf8proc_isupper
utf8proc_iterate=sherpa_onnx_utf8proc_iterate
utf8proc_map=sherpa_onnx_utf8proc_map
utf8proc_map_custom=sherpa_onnx_utf8proc_map_custom
utf8proc_NFC=sherpa_onnx_utf8proc_NFC
utf8proc_NFD=sherpa_onnx_utf8proc_NFD
utf8proc_NFKC=sherpa_onnx_utf8proc_NFKC
utf8proc_NFKC_Casefold=sherpa_onnx_utf8proc_NFKC_Casefold
utf8proc_NFKD=sherpa_onnx_utf8proc_NFKD
utf8proc_normalize_utf32=sherpa_onnx_utf8proc_normalize_utf32
utf8proc_reencode=sherpa_onnx_utf8proc_reencode
utf8proc_tolower=sherpa_onnx_utf8proc_tolower
utf8proc_totitle=sherpa_onnx_utf8proc_totitle
utf8proc_toupper=sherpa_onnx_utf8proc_toupper
utf8proc_unicode_version=sherpa_onnx_utf8proc_unicode_version
utf8proc_version=sherpa_onnx_utf8proc_version
)
# utf8proc renames the static library to utf8proc_static under MSVC, which # utf8proc renames the static library to utf8proc_static under MSVC, which
# would make the artifact name platform-dependent. Force it back to # would make the artifact name platform-dependent. Force it back to
# "utf8proc" everywhere so -lutf8proc / utf8proc.lib / {$linklib utf8proc} # "utf8proc" everywhere so -lutf8proc / utf8proc.lib / {$linklib utf8proc}
+2 -3
View File
@@ -1,9 +1,10 @@
include_guard(GLOBAL)
function(download_websocketpp) function(download_websocketpp)
include(FetchContent) include(FetchContent)
# The latest commit on the develop branch os as 2022-10-22 # The latest commit on the develop branch os as 2022-10-22
set(websocketpp_URL "https://github.com/zaphoyd/websocketpp/archive/b9aeec6eaf3d5610503439b4fae3581d9aff08e8.zip") set(websocketpp_URL "https://github.com/zaphoyd/websocketpp/archive/b9aeec6eaf3d5610503439b4fae3581d9aff08e8.zip")
set(websocketpp_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/websocketpp-b9aeec6eaf3d5610503439b4fae3581d9aff08e8.zip")
set(websocketpp_HASH "SHA256=1385135ede8191a7fbef9ec8099e3c5a673d48df0c143958216cd1690567f583") set(websocketpp_HASH "SHA256=1385135ede8191a7fbef9ec8099e3c5a673d48df0c143958216cd1690567f583")
# If you don't have access to the Internet, # If you don't have access to the Internet,
@@ -21,7 +22,6 @@ function(download_websocketpp)
set(websocketpp_URL "${f}") set(websocketpp_URL "${f}")
file(TO_CMAKE_PATH "${websocketpp_URL}" websocketpp_URL) file(TO_CMAKE_PATH "${websocketpp_URL}" websocketpp_URL)
message(STATUS "Found local downloaded websocketpp: ${websocketpp_URL}") message(STATUS "Found local downloaded websocketpp: ${websocketpp_URL}")
set(websocketpp_URL2)
break() break()
endif() endif()
endforeach() endforeach()
@@ -29,7 +29,6 @@ function(download_websocketpp)
FetchContent_Declare(websocketpp FetchContent_Declare(websocketpp
URL URL
${websocketpp_URL} ${websocketpp_URL}
${websocketpp_URL2}
URL_HASH ${websocketpp_HASH} URL_HASH ${websocketpp_HASH}
) )
+2 -1
View File
@@ -75,7 +75,8 @@ function check_style() {
if [[ $1 == mfc-example* ]]; then if [[ $1 == mfc-example* ]]; then
return return
fi fi
python3 $cpplint_src $1 || abort $1 # Silence vendored-cpplint DeprecationWarnings (sre_compile, codecs.open ...)
python3 -W ignore::DeprecationWarning $cpplint_src $1 || abort $1
} }
function check_last_commit() { function check_last_commit() {
@@ -113,6 +113,7 @@ _SherpaOnnxOfflineSpeakerDiarizationResultSortByStartTime
_SherpaOnnxOfflineSpeakerDiarizationSetConfig _SherpaOnnxOfflineSpeakerDiarizationSetConfig
_SherpaOnnxOfflineSpeechDenoiserGetSampleRate _SherpaOnnxOfflineSpeechDenoiserGetSampleRate
_SherpaOnnxOfflineSpeechDenoiserRun _SherpaOnnxOfflineSpeechDenoiserRun
_SherpaOnnxOfflineSpeechDenoiserSetVoiceSample
_SherpaOnnxOfflineStreamGetOption _SherpaOnnxOfflineStreamGetOption
_SherpaOnnxOfflineStreamHasOption _SherpaOnnxOfflineStreamHasOption
_SherpaOnnxOfflineStreamSetOption _SherpaOnnxOfflineStreamSetOption
@@ -133,6 +134,7 @@ _SherpaOnnxOnlineSpeechDenoiserGetFrameShiftInSamples
_SherpaOnnxOnlineSpeechDenoiserGetSampleRate _SherpaOnnxOnlineSpeechDenoiserGetSampleRate
_SherpaOnnxOnlineSpeechDenoiserReset _SherpaOnnxOnlineSpeechDenoiserReset
_SherpaOnnxOnlineSpeechDenoiserRun _SherpaOnnxOnlineSpeechDenoiserRun
_SherpaOnnxOnlineSpeechDenoiserSetVoiceSample
_SherpaOnnxOnlineStreamAcceptWaveform _SherpaOnnxOnlineStreamAcceptWaveform
_SherpaOnnxOnlineStreamGetOption _SherpaOnnxOnlineStreamGetOption
_SherpaOnnxOnlineStreamHasOption _SherpaOnnxOnlineStreamHasOption