From 46ef3c6a11e9713c24aa3e9b01c658b2941a58d6 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Sat, 25 Nov 2017 12:09:10 +0100 Subject: [PATCH] Fix rpmalloc debug build with GCC < 5 --- src/3rdparty/rpmalloc/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/rpmalloc/CMakeLists.txt b/src/3rdparty/rpmalloc/CMakeLists.txt index b71af279b..23d1551c2 100644 --- a/src/3rdparty/rpmalloc/CMakeLists.txt +++ b/src/3rdparty/rpmalloc/CMakeLists.txt @@ -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()