Skip to content

Commit

Permalink
Change compiler flag for serialization to enabling instead of disabli…
Browse files Browse the repository at this point in the history
…ng. (#748)

* Change compiler flag for serialization to enabling instead of disabling.

* .
  • Loading branch information
niklas-uhl authored Sep 9, 2024
1 parent 1411fd4 commit 8679c87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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
8 changes: 4 additions & 4 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 @@ -103,7 +103,7 @@ struct serialization_support_tag {};
/// @brief Type trait to check if a type is a serialization buffer.
template <typename>
constexpr bool is_serialization_buffer_v_impl = false;
#if !defined(KAMPING_DISABLE_SERIALIZATION)
#ifdef KAMPING_ENABLE_SERIALIZATION
/// @brief Type trait to check if a type is a serialization buffer.
template <typename... Args>
constexpr bool is_serialization_buffer_v_impl<SerializationBuffer<Args...>> = true;
Expand All @@ -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

0 comments on commit 8679c87

Please sign in to comment.