Skip to content

Commit

Permalink
Fix build error of deprecated api (#697)
Browse files Browse the repository at this point in the history
* fix: fix build error of deprecated api

Build failed on Trime procject with boost 1.83.0

This error begins on upstream librime(0d12d90) and boost 1.83.0

/trime/app/src/main/jni/librime/src/rime/lever/customizer.cc:91:11: error: 'copy_file' is deprecated: Use copy_options instead of copy_option [-Werror,-Wdeprecated-declarations]

* require boost minimum 1.74

---------

Co-authored-by: Qijia Liu <liumeo@pku.edu.cn>
  • Loading branch information
Bambooin and eagleoflqj authored Aug 21, 2023
1 parent 0d12d90 commit 402137c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ else()
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} signals)
endif()

find_package(Boost 1.46.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
find_package(Boost 1.74.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion src/rime/lever/customizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool Customizer::UpdateConfigFile() {
if (redistribute || (is_dirty && !missing_original_copy)) {
try {
fs::copy_file(source_path_, dest_path_,
fs::copy_option::overwrite_if_exists);
fs::copy_options::overwrite_existing);
} catch (...) {
LOG(ERROR) << "Error copying config file '" << source_path_.string()
<< "' to user directory.";
Expand Down
2 changes: 1 addition & 1 deletion src/rime/lever/deployment_tasks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ bool BackupConfigFiles::Run(Deployer* deployer) {
continue;
}
boost::system::error_code ec;
fs::copy_file(entry, backup, fs::copy_option::overwrite_if_exists, ec);
fs::copy_file(entry, backup, fs::copy_options::overwrite_existing, ec);
if (ec) {
LOG(ERROR) << "error backing up file " << backup.string();
++failure;
Expand Down

0 comments on commit 402137c

Please sign in to comment.