diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 3f349c63..a7693fb6 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -23,6 +23,7 @@ option(MULTITHREADING "Enable multi-threading" ON) option(TESTING "Build tests" ON) option(ENABLE_ASAN "Address sanitizer for debugging tricky memory corruption" OFF) option(BENCHMARKS "Build benchmarks" ON) +option(SERIALIZE_CANARY "Enable serialization checks" OFF) option(FUZZING "Build fuzzing harnesses" OFF) option(DISABLE_TBB "Intel Thread Building Blocks" ON) option(COVERAGE "Enable collecting coverage from tests" OFF) @@ -43,6 +44,10 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "a set(DISABLE_TBB 0) endif() +if(SERIALIZE_CANARY) + add_definitions(-DENABLE_SERIALIZE_CANARY) +endif() + if(FUZZING) add_definitions(-DFUZZING=1) diff --git a/cpp/cmake/barretenberg.cmake b/cpp/cmake/barretenberg.cmake index 9a2793e9..85013208 100644 --- a/cpp/cmake/barretenberg.cmake +++ b/cpp/cmake/barretenberg.cmake @@ -31,7 +31,7 @@ ExternalProject_Add(Barretenberg BUILD_ALWAYS TRUE UPDATE_COMMAND "" INSTALL_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} --preset ${CMAKE_BBERG_PRESET} + CONFIGURE_COMMAND ${CMAKE_COMMAND} --preset ${CMAKE_BBERG_PRESET} -DSERIALIZE_CANARY=${SERIALIZE_CANARY} -DENABLE_ASAN=${ENABLE_ASAN} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} BUILD_COMMAND ${CMAKE_COMMAND} --build --preset ${CMAKE_BBERG_PRESET} --target barretenberg --target env # byproducts needed by ninja generator (not needed by make) BUILD_BYPRODUCTS ${BBERG_BUILD_DIR}/lib/libbarretenberg.a ${BBERG_BUILD_DIR}/lib/libenv.a)