Skip to content

Commit

Permalink
Fix rpmalloc debug build with GCC < 5
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Nov 25, 2017
1 parent c6ae1dc commit 46ef3c6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/3rdparty/rpmalloc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ if (NOT LMMS_BUILD_WIN32)
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
# rpmalloc uses GCC builtin "__builtin_umull_overflow" with ENABLE_VALIDATE_ARGS,
# which is only available starting with GCC 5
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5)
set(ENABLE_VALIDATE_ARGS OFF)
else ()
set(ENABLE_VALIDATE_ARGS ON)
endif()
target_compile_definitions(rpmalloc
PRIVATE -DENABLE_ASSERTS=1 -DENABLE_VALIDATE_ARGS=1
PRIVATE -DENABLE_ASSERTS=1 -DENABLE_VALIDATE_ARGS=${ENABLE_VALIDATE_ARGS}
)
endif()

Expand Down

0 comments on commit 46ef3c6

Please sign in to comment.