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

Change compiler flag for serialization to enabling instead of disabling. #748

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ if (KAMPING_ENABLE_SERIALIZATION)
message(STATUS "Cereal: building from source.")
endif ()
target_link_libraries(kamping_base INTERFACE cereal::cereal)
target_compile_definitions(kamping_base INTERFACE KAMPING_ENABLE_SERIALIZATION)
message(STATUS "Serialization: enabled")
else ()
target_compile_definitions(kamping_base INTERFACE KAMPING_DISABLE_SERIALIZATION)
message(STATUS "Serialization: disabled")
endif ()

Expand Down
6 changes: 3 additions & 3 deletions include/kamping/serialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

#include <type_traits>

#if !defined(KAMPING_DISABLE_SERIALIZATION)
#ifdef KAMPING_ENABLE_SERIALIZATION
#include "cereal/archives/binary.hpp"
#endif
#include "kamping/data_buffer.hpp"

namespace kamping {
namespace internal {
#if !defined(KAMPING_DISABLE_SERIALIZATION)
#ifdef KAMPING_ENABLE_SERIALIZATION

/// @brief Buffer holding serialized data.
///
Expand Down Expand Up @@ -128,7 +128,7 @@ auto deserialization_repack(BufferType buffer) {
}
}
} // namespace internal
#if !defined(KAMPING_DISABLE_SERIALIZATION)
#ifdef KAMPING_ENABLE_SERIALIZATION
/// @brief Serializes an object using [`cereal`](https://uscilab.github.io/cereal/).
/// @tparam Archive Type of the archive to use for serialization (see
/// https://uscilab.github.io/cereal/serialization_archives.html). Default is `cereal::BinaryOutputArchive`.
Expand Down
Loading