September 2018
Intermediate to advanced
606 pages
14h 32m
English
The following shows how to set up CMakeLists.txt to perform the dynamic analysis of the code:
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)project(recipe-05 LANGUAGES CXX)set(CMAKE_CXX_STANDARD 11)set(CMAKE_CXX_EXTENSIONS OFF)set(CMAKE_CXX_STANDARD_REQUIRED ON)add_library(example_library leaky_implementation.cpp)
add_executable(cpp_test test.cpp)target_link_libraries(cpp_test example_library)
find_program(MEMORYCHECK_COMMAND NAMES valgrind)set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full")# add memcheck test actioninclude(CTest)enable_testing() ...
Read now
Unlock full access