Created
January 1, 2023 05:13
-
-
Save batunpc/318f6650980265cb1754e88e923d1457 to your computer and use it in GitHub Desktop.
use heapcheck with CMake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the path to the GPerfTools library | |
find_library(GPERFTOOLS_LIBRARIES tcmalloc) | |
# Set the flags needed to build with heapcheck | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") | |
# Add the heapcheck library to your target | |
target_link_libraries(my_target ${GPERFTOOLS_LIBRARIES}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment