Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ jobs:
matrix:
include: [
{ name: 'ARM64', xcc_pkg: gcc-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static, os: ubuntu-latest, },

{ name: 'ARM64, gcc-9', xcc_pkg: gcc-9-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc-9, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static, os: ubuntu-20.04, },
]
env: # Set environment variables
Expand Down
2 changes: 1 addition & 1 deletion build-and-run-no-jieba
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ simple.example() {
run "./sqlite3 < ${ProjectRoot}/example.sql"
run "./simple_cpp_example"
run "cd ${ProjectRoot}"
run "python3 examples/python3/db_connector.py"
run "python3 examples/python3/db_connector.py './output/bin/libsimple'"
}

main() {
Expand Down
13 changes: 7 additions & 6 deletions examples/cpp/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ int main() {
handle_rc(db, rc);
ms pinyin = Clock::now() - before;
std::cout << "It took " << pinyin.count() << "ms to init pinyin" << std::endl;
before = Clock::now();
sql = "select jieba_query('结巴')";
rc = sqlite3_exec(db, sql.c_str(), callback, 0, &zErrMsg);
handle_rc(db, rc);
ms warm_up = Clock::now() - before;
std::cout << "It took " << warm_up.count() << "ms to init jieba" << std::endl;

before = Clock::now();
// create fts table
Expand Down Expand Up @@ -112,6 +106,13 @@ int main() {
rc = sqlite3_exec(db, sql.c_str(), callback, 0, &zErrMsg);
handle_rc(db, rc);
#ifdef USE_JIEBA
before = Clock::now();
sql = "select jieba_query('结巴')";
rc = sqlite3_exec(db, sql.c_str(), callback, 0, &zErrMsg);
handle_rc(db, rc);
ms warm_up = Clock::now() - before;
std::cout << "It took " << warm_up.count() << "ms to init jieba" << std::endl;

// set dict path manually
string dict_path = get_current_dir() + "/dict";
sql = "select jieba_dict('" + dict_path + "')";
Expand Down
6 changes: 4 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ if(SIMPLE_WITH_JIEBA)
ExternalProject_Add(
cppjieba
PREFIX ${CMAKE_BINARY_DIR}/cppjieba
GIT_REPOSITORY https://github.com/yanyiwu/cppjieba.git
GIT_REPOSITORY https://github.com/wangfenjin/cppjieba.git
CONFIGURE_COMMAND ""
GIT_TAG 194c144d8b5ed1baf3190d07c5226e804454ab47
GIT_TAG master
BUILD_COMMAND cmake -E echo "Skipping build cppjieba."
INSTALL_COMMAND cmake -E echo "Skipping install cppjieba."
LOG_DOWNLOAD ON
Expand Down Expand Up @@ -38,6 +38,8 @@ if(SIMPLE_WITH_JIEBA)
add_dependencies(simple cppjieba)
include_directories(${SQLITE3_HEADERS_DIR} ${source_dir}/include ${source_dir}/deps)
target_include_directories(simple INTERFACE ${SQLITE3_HEADERS_DIR} ${source_dir}/include ${source_dir}/deps)
set_source_files_properties(${source_dir}/deps/limonp/Md5.cpp PROPERTIES GENERATED TRUE)
target_sources(simple PRIVATE ${source_dir}/deps/limonp/Md5.cpp)
# for tests only
add_custom_command(TARGET simple PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
Expand Down