Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace boost git submodule with source tarball to build #1102

Merged
merged 2 commits into from
Nov 14, 2023
Merged
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
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
21 changes: 14 additions & 7 deletions 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 Expand Up @@ -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)
1 change: 0 additions & 1 deletion app/src/main/jni/boost
Submodule boost deleted from 564e2a
Loading