1
0
mirror of https://github.com/danog/ton.git synced 2024-11-30 04:29:19 +01:00
ton/memprof/CMakeLists.txt
2019-09-07 14:33:36 +04:00

23 lines
741 B
CMake

cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
set(MEMPROF_SOURCE
memprof/memprof.cpp
memprof/memprof.h
)
# memprof - simple library for memory usage profiling
add_library(memprof STATIC ${MEMPROF_SOURCE})
target_include_directories(memprof PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(memprof PRIVATE tdutils)
if (MEMPROF)
target_compile_definitions(memprof PRIVATE -DUSE_MEMPROF=1)
if (MEMPROF STREQUAL "SAFE")
target_compile_definitions(memprof PRIVATE -DUSE_MEMPROF_SAFE=1)
elseif (MEMPROF STREQUAL "FAST")
target_compile_definitions(memprof PRIVATE -DUSE_MEMPROF_FAST=1)
elseif (NOT MEMPROF)
message(FATAL_ERROR "Unsupported MEMPROF value \"${MEMPROF}\"")
endif()
endif()