Compare commits
2 Commits
3a6cc9cd24
...
d0c0f04642
Author | SHA1 | Date | |
---|---|---|---|
d0c0f04642 | |||
f82e202f4d |
19
external/CMakeLists.txt
vendored
19
external/CMakeLists.txt
vendored
@ -27,3 +27,22 @@ if (NOT TARGET nlohmann_json::nlohmann_json)
|
|||||||
FetchContent_MakeAvailable(json)
|
FetchContent_MakeAvailable(json)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT TARGET zstd::zstd)
|
||||||
|
# TODO: try find_package() first
|
||||||
|
# TODO: try pkg-config next (will work on most distros)
|
||||||
|
|
||||||
|
set(ZSTD_BUILD_STATIC ON)
|
||||||
|
set(ZSTD_BUILD_SHARED OFF)
|
||||||
|
set(ZSTD_BUILD_PROGRAMS OFF)
|
||||||
|
set(ZSTD_BUILD_CONTRIB OFF)
|
||||||
|
set(ZSTD_BUILD_TESTS OFF)
|
||||||
|
FetchContent_Declare(zstd
|
||||||
|
URL "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz"
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
||||||
|
SOURCE_SUBDIR build/cmake
|
||||||
|
EXCLUDE_FROM_ALL
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(zstd)
|
||||||
|
|
||||||
|
add_library(zstd::zstd ALIAS libzstd_static)
|
||||||
|
endif()
|
||||||
|
@ -58,8 +58,11 @@
|
|||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"TOMATO_ASAN=1"
|
"TOMATO_ASAN=1"
|
||||||
"CMAKE_BUILD_TYPE=RelWithDebInfo"
|
"CMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||||
|
|
||||||
"-DFETCHCONTENT_SOURCE_DIR_JSON=${pkgs.nlohmann_json.src}" # we care less about version here
|
"-DFETCHCONTENT_SOURCE_DIR_JSON=${pkgs.nlohmann_json.src}" # we care less about version here
|
||||||
# do we really care less about the version? do we need a stable abi?
|
# do we really care less about the version? do we need a stable abi?
|
||||||
|
|
||||||
|
"-DFETCHCONTENT_SOURCE_DIR_ZSTD=${pkgs.zstd.src}"
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO: replace with install command
|
# TODO: replace with install command
|
||||||
|
@ -36,7 +36,7 @@ bool MessageSerializerCallbacks::component_emplace_or_replace_json<Message::Comp
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto id = static_cast<std::vector<uint8_t>>(j.is_binary()?j:j["bytes"]);
|
const std::vector<uint8_t> id = j.is_binary()?j:j["bytes"];
|
||||||
|
|
||||||
// TODO: id lookup table, this is very inefficent
|
// TODO: id lookup table, this is very inefficent
|
||||||
for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) {
|
for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) {
|
||||||
@ -79,7 +79,7 @@ bool MessageSerializerCallbacks::component_emplace_or_replace_json<Message::Comp
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto id = static_cast<std::vector<uint8_t>>(j.is_binary()?j:j["bytes"]);
|
const std::vector<uint8_t> id = j.is_binary()?j:j["bytes"];
|
||||||
|
|
||||||
// TODO: id lookup table, this is very inefficent
|
// TODO: id lookup table, this is very inefficent
|
||||||
for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) {
|
for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user