diff --git a/.gitmodules b/.gitmodules index 22b8593b3e..a4791ae3d8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,6 @@ [submodule "snappy"] path = app/src/main/jni/snappy url = https://github.com/google/snappy.git -[submodule "boost"] - path = app/src/main/jni/boost - url = https://github.com/boostorg/boost.git [submodule "librime"] path = app/src/main/jni/librime url = https://github.com/rime/librime.git diff --git a/app/src/main/jni/CMakeLists.txt b/app/src/main/jni/CMakeLists.txt index 79dd7f0402..b84a05d99e 100644 --- a/app/src/main/jni/CMakeLists.txt +++ b/app/src/main/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.10.0) +cmake_minimum_required (VERSION 3.18.0) project(trime-lib VERSION 3.0.0) @@ -16,6 +16,18 @@ include(Iconv) # workaround for boost install install(TARGETS iconv EXPORT boost_locale-targets) +set(BOOST_VER 1.83.0) +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/boost) + file( + DOWNLOAD "https://github.com/boostorg/boost/releases/download/boost-${BOOST_VER}/boost-${BOOST_VER}.tar.xz" boost-${BOOST_VER}.tar.xz + EXPECTED_HASH SHA256=c5a0688e1f0c05f354bbd0b32244d36085d9ffc9f932e8a18983a9908096f614 + SHOW_PROGRESS + ) + file(ARCHIVE_EXTRACT INPUT boost-${BOOST_VER}.tar.xz + DESTINATION ${CMAKE_SOURCE_DIR} + ) + file(RENAME "boost-${BOOST_VER}" boost) +endif() add_subdirectory(boost) option(WITH_GFLAGS "Use gflags" OFF) @@ -51,12 +63,7 @@ include_directories( PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/librime/deps/glog" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/librime/deps/glog/src" ) -# workaround for librime/tools/rime_api_console.cc -# TODO: fix it in upstream -string(REPLACE "-Werror=format-security" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) -string(REPLACE "-Wformat" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) -add_definitions("-Wno-format") -# workaround end + add_subdirectory(librime) add_subdirectory(librime_jni) diff --git a/app/src/main/jni/boost b/app/src/main/jni/boost deleted file mode 160000 index 564e2ac169..0000000000 --- a/app/src/main/jni/boost +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 564e2ac16907019696cdaba8a93e3588ec596062