From cceace2ef04fef070d2569ca8fecaa578129b949 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Tue, 9 May 2023 16:22:25 +0200 Subject: [PATCH] minor change in CMakeLists.txt + fix preprocessor variables to prevent extra semicolon error --- CMakeLists.txt | 5 ++++- src/include/base/macros.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5e9ee7..47284fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,10 @@ endif() find_package(cereal QUIET) if(cereal_FOUND) message(STATUS "found cereal") - add_definitions(-DHAVE_CEREAL) + if(ENABLE_cereal) + message(STATUS "enable cereal") + add_definitions(-DHAVE_CEREAL) + endif() else() message(STATUS "no cereal") if(ENABLE_cereal) diff --git a/src/include/base/macros.h b/src/include/base/macros.h index 61ebcb4..297d97c 100644 --- a/src/include/base/macros.h +++ b/src/include/base/macros.h @@ -45,8 +45,8 @@ template void save(Archive& ar, const std::uint32_t version) const; \ template void load(Archive& ar, const std::uint32_t version) #else -#define SERIALIZATION_FUNCTIONS -#define SERIALIZATION_FUNCTIONS_NOPUB +#define SERIALIZATION_FUNCTIONS static const int v = 0 +#define SERIALIZATION_FUNCTIONS_NOPUB static const int v = 0 #endif #endif