Skip to content

Commit

Permalink
Enable building in Debug mode if the user really wants this
Browse files Browse the repository at this point in the history
Also inform the user about slow performance if they do this.
  • Loading branch information
ojura committed Mar 29, 2017
1 parent 1f7b5a9 commit 1ce97b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmake/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ macro(google_initialize_cartographer_project)
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
google_add_flag(GOOG_CXX_FLAGS "-O3 -g -DNDEBUG")
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(FATAL_ERROR "Compiling in debug mode is not supported.")
if(NOT FORCE_DEBUG_BUILD)
message(FATAL_ERROR
"Compiling in debug mode is not supported and can cause severely degraded performance. \
If you wish to continue anyway, call CMake with -DFORCE_DEBUG_BUILD=True")
else()
message(WARNING "Building in Debug mode, expect very slow performance.")
google_add_flag(GOOG_CXX_FLAGS "-g")
endif()
else()
message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()
Expand Down

0 comments on commit 1ce97b8

Please sign in to comment.