Skip to content

Commit

Permalink
build(jni): try to replace boost git submodule with source tarball
Browse files Browse the repository at this point in the history
This may off about 50% of the build time.
  • Loading branch information
WhiredPlanck committed Nov 13, 2023
1 parent e0a7105 commit db1581f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion app/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/jni/boost
Submodule boost deleted from 564e2a

0 comments on commit db1581f

Please sign in to comment.