2016-12-24 01:03:10 +00:00
|
|
|
|
2017-08-03 12:44:39 +00:00
|
|
|
message (STATUS "Building: tcmalloc_minimal_internal")
|
2016-11-29 22:36:32 +00:00
|
|
|
|
2016-05-28 00:32:37 +00:00
|
|
|
add_library (tcmalloc_minimal_internal
|
2016-05-22 19:56:47 +00:00
|
|
|
./src/malloc_hook.cc
|
|
|
|
./src/base/spinlock_internal.cc
|
|
|
|
./src/base/spinlock.cc
|
|
|
|
./src/base/dynamic_annotations.c
|
|
|
|
./src/base/linuxthreads.cc
|
|
|
|
./src/base/elf_mem_image.cc
|
|
|
|
./src/base/vdso_support.cc
|
|
|
|
./src/base/sysinfo.cc
|
|
|
|
./src/base/low_level_alloc.cc
|
|
|
|
./src/base/thread_lister.c
|
|
|
|
./src/base/logging.cc
|
|
|
|
./src/base/atomicops-internals-x86.cc
|
|
|
|
./src/memfs_malloc.cc
|
|
|
|
./src/tcmalloc.cc
|
|
|
|
./src/malloc_extension.cc
|
|
|
|
./src/thread_cache.cc
|
|
|
|
./src/symbolize.cc
|
|
|
|
./src/page_heap.cc
|
|
|
|
./src/maybe_threads.cc
|
|
|
|
./src/central_freelist.cc
|
|
|
|
./src/static_vars.cc
|
|
|
|
./src/sampler.cc
|
|
|
|
./src/internal_logging.cc
|
|
|
|
./src/system-alloc.cc
|
|
|
|
./src/span.cc
|
|
|
|
./src/common.cc
|
|
|
|
./src/debugallocation.cc
|
|
|
|
./src/stacktrace.cc
|
|
|
|
./src/stack_trace_table.cc
|
|
|
|
./src/heap-checker.cc
|
|
|
|
./src/heap-checker-bcad.cc
|
|
|
|
./src/heap-profile-table.cc
|
|
|
|
./src/raw_printer.cc
|
|
|
|
./src/memory_region_map.cc
|
2016-05-22 00:32:13 +00:00
|
|
|
)
|
2017-08-03 12:44:39 +00:00
|
|
|
|
|
|
|
target_compile_options (tcmalloc_minimal_internal PUBLIC
|
|
|
|
-DNO_TCMALLOC_SAMPLES
|
|
|
|
-DNDEBUG
|
|
|
|
-DNO_FRAME_POINTER
|
|
|
|
-Wwrite-strings
|
|
|
|
-Wno-sign-compare
|
|
|
|
-Wno-unused-result
|
|
|
|
-Wno-deprecated-declarations
|
|
|
|
-Wno-unused-function
|
|
|
|
-Wno-unused-private-field
|
|
|
|
-fno-builtin-malloc
|
|
|
|
-fno-builtin-free
|
|
|
|
-fno-builtin-realloc
|
|
|
|
-fno-builtin-calloc
|
|
|
|
-fno-builtin-cfree
|
|
|
|
-fno-builtin-memalign
|
|
|
|
-fno-builtin-posix_memalign
|
|
|
|
-fno-builtin-valloc
|
|
|
|
-fno-builtin-pvalloc
|
|
|
|
)
|
|
|
|
|
2017-10-18 12:24:56 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.9.1)
|
2017-08-03 12:44:39 +00:00
|
|
|
target_compile_options(tcmalloc_minimal_internal PUBLIC -Wno-dynamic-exception-spec )
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (CMAKE_SYSTEM MATCHES "FreeBSD" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
target_compile_options(tcmalloc_minimal_internal PUBLIC -Wno-unused-but-set-variable)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (CMAKE_SYSTEM MATCHES "FreeBSD")
|
|
|
|
target_compile_definitions(tcmalloc_minimal_internal PUBLIC _GNU_SOURCE)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
target_include_directories (tcmalloc_minimal_internal PUBLIC include)
|
|
|
|
target_include_directories (tcmalloc_minimal_internal PRIVATE src)
|
|
|
|
|
2017-10-13 18:58:19 +00:00
|
|
|
find_package (Threads)
|
|
|
|
target_link_libraries (tcmalloc_minimal_internal ${CMAKE_THREAD_LIBS_INIT})
|