Skip to content

Commit 30765be

Browse files
committed
fix build issue & upgrade pybind11
1 parent 5cd5a8e commit 30765be

3 files changed

Lines changed: 8 additions & 15 deletions

File tree

.github/workflows/build-wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
shell: bash
3838
run: |
3939
python3 -m pip install cppinyin
40-
python3 -c "import cppinyin; e = cppinyin.Encoder('cppinyin/python/cppinyin/resources/pinyin.raw'); e.save('cppinyin/python/cppinyin/resources/pinyin.dict');"
40+
python3 -c "import cppinyin; import os; e = cppinyin.Encoder('cppinyin/python/cppinyin/resources/pinyin.raw'); e.save('cppinyin/python/cppinyin/resources/pinyin.dict'); os.remove('cppinyin/python/cppinyin/resources/pinyin.raw')"
4141
4242
# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
4343
# for a list of versions

cmake/pybind11.cmake

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
11
function(download_pybind11)
2-
if(CMAKE_VERSION VERSION_LESS 3.11)
3-
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
4-
endif()
52

63
include(FetchContent)
74

8-
# latest commit as of 2022.10.31 that supports python 3.11
9-
set(pybind11_URL "https://github.com/pybind/pybind11/archive/5bc0943ed96836f46489f53961f6c438d2935357.zip")
10-
set(pybind11_URL2 "https://huggingface.co/csukuangfj/k2-cmake-deps/resolve/main/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip")
11-
set(pybind11_HASH "SHA256=ff65a1a8c9e6ceec11e7ed9d296f2e22a63e9ff0c4264b3af29c72b4f18f25a0")
5+
set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.zip")
6+
set(pybind11_HASH "SHA256=b011a730c8845bfc265f0f81ee4e5e9e1d354df390836d2a25880e123d021f89")
127

138
# If you don't have access to the Internet,
149
# please pre-download pybind11
1510
set(possible_file_locations
16-
$ENV{HOME}/Downloads/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
17-
${PROJECT_SOURCE_DIR}/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
18-
${PROJECT_BINARY_DIR}/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
19-
/tmp/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
20-
/star-fj/fangjun/download/github/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
11+
$ENV{HOME}/Downloads/pybind11-2.11.1.tar.gz
12+
${PROJECT_SOURCE_DIR}/pybind11-2.11.1.tar.gz
13+
${PROJECT_BINARY_DIR}/pybind11-2.11.1.tar.gz
14+
/tmp/pybind11-2.11.1.tar.gz
2115
)
2216

2317
foreach(f IN LISTS possible_file_locations)
2418
if(EXISTS ${f})
2519
set(pybind11_URL "${f}")
2620
file(TO_CMAKE_PATH "${pybind11_URL}" pybind11_URL)
27-
set(pybind11_URL2)
2821
break()
2922
endif()
3023
endforeach()
3124

3225
FetchContent_Declare(pybind11
3326
URL
3427
${pybind11_URL}
35-
${pybind11_URL2}
3628
URL_HASH ${pybind11_HASH}
3729
)
3830

cppinyin/csrc/utils.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "cppinyin/csrc/utils.h"
2+
#include <cstdint>
23
#include <fstream>
34
#include <iostream>
45
#include <string>

0 commit comments

Comments
 (0)