minor change in CMakeLists.txt + fix preprocessor variables to prevent extra semicolon error

This commit is contained in:
Christian Zimmermann 2023-05-09 16:22:25 +02:00
parent 7ea21da81a
commit cceace2ef0
2 changed files with 6 additions and 3 deletions

View file

@ -60,7 +60,10 @@ endif()
find_package(cereal QUIET) find_package(cereal QUIET)
if(cereal_FOUND) if(cereal_FOUND)
message(STATUS "found cereal") message(STATUS "found cereal")
add_definitions(-DHAVE_CEREAL) if(ENABLE_cereal)
message(STATUS "enable cereal")
add_definitions(-DHAVE_CEREAL)
endif()
else() else()
message(STATUS "no cereal") message(STATUS "no cereal")
if(ENABLE_cereal) if(ENABLE_cereal)

View file

@ -45,8 +45,8 @@
template <class Archive> void save(Archive& ar, const std::uint32_t version) const; \ template <class Archive> void save(Archive& ar, const std::uint32_t version) const; \
template <class Archive> void load(Archive& ar, const std::uint32_t version) template <class Archive> void load(Archive& ar, const std::uint32_t version)
#else #else
#define SERIALIZATION_FUNCTIONS #define SERIALIZATION_FUNCTIONS static const int v = 0
#define SERIALIZATION_FUNCTIONS_NOPUB #define SERIALIZATION_FUNCTIONS_NOPUB static const int v = 0
#endif #endif
#endif #endif