From 5318ac7c54dbf33b17ccc4bd3281bb8b8db25e02 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 16 May 2021 11:33:25 +0400 Subject: [PATCH] Add external_mallocng module --- external/CMakeLists.txt | 3 +++ external/mallocng/CMakeLists.txt | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 external/mallocng/CMakeLists.txt diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 3521f29..53a57d8 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -41,6 +41,9 @@ if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) add_checked_subdirectory(kwayland) endif() add_checked_subdirectory(lz4) +if (LINUX) + add_checked_subdirectory(mallocng) +endif() add_checked_subdirectory(minizip) if (LINUX) add_checked_subdirectory(nimf_qt5) diff --git a/external/mallocng/CMakeLists.txt b/external/mallocng/CMakeLists.txt new file mode 100644 index 0000000..34b97ed --- /dev/null +++ b/external/mallocng/CMakeLists.txt @@ -0,0 +1,38 @@ +# This file is part of Desktop App Toolkit, +# a set of libraries for developing nice desktop applications. +# +# For license and copyright information please follow this link: +# https://github.com/desktop-app/legal/blob/master/LEGAL + +add_library(external_mallocng STATIC) +add_library(desktop-app::external_mallocng ALIAS external_mallocng) +init_target(external_mallocng "(external)") + +set(mallocng_loc ${third_party_loc}/mallocng) + +nice_target_sources(external_mallocng ${mallocng_loc} +PRIVATE + malloc.c + calloc.c + free.c + realloc.c + aligned_alloc.c + posix_memalign.c + memalign.c + malloc_usable_size.c + meta.h + glue.h +) + +target_include_directories(external_mallocng +PRIVATE + ${mallocng_loc} +) + +target_compile_options(external_mallocng +PUBLIC + -fno-builtin-malloc + -fno-builtin-calloc + -fno-builtin-realloc + -fno-builtin-free +)