Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects

Don't use GLIBCXX_ASSERTIONS in production

Merged kraus requested to merge 627-add-wp-d_glibcxx_assertions-to-the-build-flags-3 into master
2 unresolved threads
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
+ 10
1
@@ -26,6 +26,13 @@ set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g ")
set (CMAKE_CXX_FLAGS_RELEASE "-O3")
set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if (uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELWITHDEBINFO)$")
option (BUILD_FOR_PRODUCTION "Disable all assertion checks; Only use for production" OFF)
else()
option (BUILD_FOR_PRODUCTION "Disable all assertion checks; Only use for production" ON)
endif()
# Resolve all library dependencies
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
@@ -101,7 +108,9 @@ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
# Enables extra error checking in the form of precondition assertion, such
# as bounds checking and null pointer checks when dereferencing smart pointers
add_compile_options(-Wp,-D_GLIBCXX_ASSERTIONS)
if (NOT ${BUILD_FOR_PRODUCTION})
add_compile_options(-Wp,-D_GLIBCXX_ASSERTIONS)
endif()
    • @kraus sorry, did not saw this MR.

      Actually I would prefer to have this option in for all build types as long as the code has not been released. Hence in the master it should be in for all build types.

      • Author Developer

        Ok, that's fine for me. However we then should extend the description of the procedure to release new versions such that you (or who ever prepares a new release) don't forget to remove this flag.

      • We can use the version number or another mechanism for this.

      • Author Developer

        Could you make a more discreet proposition? E.g. always off when minor version is even?

      • I see these two options:

        1. minor version is even
        2. a variable set in the header of the main CMakeLists.txt. This has the advantage of being more independent from the version numbers - just in case we want to change the numbering scheme.
      • Author Developer

        Ok, I've opted for the second proposition.

      • Please register or sign in to reply
Please register or sign in to reply
else ()
message (STATUS "Unknown C++ compiler. Please use the GNU or Intel compiler, if you are having problems.")
endif ()
Loading