Skip to content

Commit

Permalink
Fixed slow MSAN debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed Mar 4, 2025
1 parent d006ac2 commit 94efdd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,10 @@ else()
endif()

message(STATUS "Summary of build options:
C compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})
CXX compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_ID})
C_FLAGS: ${CMAKE_C_FLAGS}
CXX_FLAGS: ${CMAKE_CXX_FLAGS}
CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}
C compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})
CXX compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_ID})
CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}
C_FLAGS: ${CMAKE_C_FLAGS}
CXX_FLAGS: ${CMAKE_CXX_FLAGS}
OPTIMIZATION_FLAGS: ${OPTIMIZATION_FLAGS}
")
6 changes: 4 additions & 2 deletions cmake/flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,15 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
endif()

if (DEV_WITH_MSAN OR DEV_DEBUG OR (CMAKE_BUILD_TYPE STREQUAL "Debug") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
add_definitions(-DDEBUG_BUILD)
if (NOT DEV_WITH_MSAN)
add_definitions(-DDEBUG_BUILD)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(OPTIMIZATION_FLAGS "-O0")
else()
set(OPTIMIZATION_FLAGS "-Og")
endif()
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -g3 -ftrapv")
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -g -ftrapv")
else()
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -fmerge-all-constants")
endif()
Expand Down

0 comments on commit 94efdd4

Please sign in to comment.