Skip to content

Commit

Permalink
improve debugging flags
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Sep 25, 2024
1 parent dabeb06 commit f907d00
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
8 changes: 6 additions & 2 deletions crypto3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ option(BUILD_BENCH_TESTS "Build performance benchmark tests" FALSE)
option(BUILD_DOCS "Build with configuring Doxygen documentation compiler" FALSE)
option(SANITIZE "Build sanitizers" FALSE)

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-ggdb -O0")
if(DEFINED CMAKE_BUILD_TYPE AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") # gdb only works well with gcc
endif()
set(BOOST_FORCEINLINE "OFF") # improves debugging traces
endif()

if(${SANITIZE})
Expand Down
8 changes: 6 additions & 2 deletions evm-assigner/lib/assigner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ cmake_minimum_required(VERSION 3.22 FATAL_ERROR)

option(BUILD_ASSIGNER_TESTS "Build unit tests" FALSE)

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-ggdb -O0")
if(DEFINED CMAKE_BUILD_TYPE AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") # gdb only works well with gcc
endif()
set(BOOST_FORCEINLINE "OFF") # improves debugging traces
endif()

set(evmone_sources
Expand Down
8 changes: 6 additions & 2 deletions parallel-crypto3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ project(parallel-crypto3)

find_package(CM)

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-ggdb -O0")
if(DEFINED CMAKE_BUILD_TYPE AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") # gdb only works well with gcc
endif()
set(BOOST_FORCEINLINE "OFF") # improves debugging traces
endif()

# This is useful due to some build systems (Ninja in particular) are piping
Expand Down
8 changes: 6 additions & 2 deletions proof-producer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@

cmake_minimum_required(VERSION 3.22 FATAL_ERROR)

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-ggdb -O0")
if(DEFINED CMAKE_BUILD_TYPE AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
set(ZK_PLACEHOLDER_DEBUG_ENABLED TRUE)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") # gdb only works well with gcc
endif()
set(BOOST_FORCEINLINE "OFF") # improves debugging traces
endif()

find_package(CM REQUIRED)
Expand Down
8 changes: 6 additions & 2 deletions transpiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ find_package(CM REQUIRED)
include(CMConfig)
include(CMSetupVersion)

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-ggdb -O0")
if(DEFINED CMAKE_BUILD_TYPE AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") # gdb only works well with gcc
endif()
set(BOOST_FORCEINLINE "OFF") # improves debugging traces
endif()

cm_workspace(crypto3)
Expand Down
8 changes: 6 additions & 2 deletions zkevm-framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ include(GNUInstallDirs)
option(BUILD_DOCS "Build documentation" FALSE)
option(ENABLE_TESTS "Enable tests" FALSE)

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-ggdb -O0")
if(DEFINED CMAKE_BUILD_TYPE AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") # gdb only works well with gcc
endif()
set(BOOST_FORCEINLINE "OFF") # improves debugging traces
endif()

add_subdirectory(libs)
Expand Down

0 comments on commit f907d00

Please sign in to comment.