mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-11 21:35:27 -04:00
refactor(dwarfs-universal): replace folly::gen with ranges
This commit is contained in:
parent
89cdb7e325
commit
4de04030f2
@ -816,7 +816,8 @@ if(WITH_UNIVERSAL_BINARY)
|
||||
add_executable(dwarfsuniversal src/universal.cpp)
|
||||
list(APPEND BINARY_TARGETS dwarfsuniversal)
|
||||
|
||||
target_link_libraries(dwarfsuniversal PRIVATE mkdwarfs_main dwarfsck_main dwarfsextract_main)
|
||||
target_link_libraries(dwarfsuniversal PRIVATE
|
||||
mkdwarfs_main dwarfsck_main dwarfsextract_main range-v3::range-v3)
|
||||
set_target_properties(dwarfsuniversal PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY universal
|
||||
OUTPUT_NAME dwarfs-universal)
|
||||
|
@ -28,9 +28,12 @@
|
||||
#include <vector>
|
||||
|
||||
#include <folly/String.h>
|
||||
#include <folly/gen/String.h>
|
||||
#include <folly/portability/Windows.h>
|
||||
|
||||
#include <range/v3/range/conversion.hpp>
|
||||
#include <range/v3/view/join.hpp>
|
||||
#include <range/v3/view/map.hpp>
|
||||
|
||||
#include <dwarfs/safe_main.h>
|
||||
#include <dwarfs/tool.h>
|
||||
#include <dwarfs/util.h>
|
||||
@ -85,11 +88,8 @@ int SYS_MAIN(int argc, sys_char** argv) {
|
||||
|
||||
// nope, just print the help
|
||||
|
||||
using namespace folly::gen;
|
||||
|
||||
// TODO: C++23
|
||||
// auto tools = std::views::keys(functions) | std::views::join_with(", ");
|
||||
auto tools = from(functions) | get<0>() | unsplit(", ");
|
||||
auto tools = ranges::views::keys(functions) | ranges::views::join(", ") |
|
||||
ranges::to<std::string>;
|
||||
|
||||
// clang-format off
|
||||
std::cout << tool_header("dwarfs-universal")
|
||||
|
Loading…
x
Reference in New Issue
Block a user