forked from KindDragon/vld
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
84 lines (70 loc) · 1.97 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(vld
VERSION 2.5.2
DESCRIPTION "Visual Leak Detector"
HOMEPAGE_URL "https://github.com/btolfa/vld"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(vld SHARED)
if (CMAKE_VS_PLATFORM_NAME STREQUAL "Win32")
set_target_properties(vld
PROPERTIES SUFFIX "_x86.dll"
EXPORT_NAME "vld_x86.lib"
LIBRARY_OUTPUT_NAME "vld_x86.lib"
#COMPILE_PDB_NAME "vld_x86"
)
endif()
if (CMAKE_VS_PLATFORM_NAME STREQUAL "x64")
set_target_properties(vld
PROPERTIES SUFFIX "_x64.dll"
EXPORT_NAME "vld__x64.lib"
LIBRARY_OUTPUT_NAME "vld_x64.lib"
#COMPILE_PDB_NAME "vld_x64"
)
endif()
target_include_directories(vld PRIVATE setup)
target_compile_definitions(vld PRIVATE UNICODE _UNICODE)
add_subdirectory(lib/cppformat fmt)
target_link_libraries(vld PRIVATE fmt)
target_sources(vld PRIVATE
src/callstack.cpp
src/dllspatches.cpp
src/ntapi.cpp
src/stdafx.cpp
src/utility.cpp
src/vld.cpp
src/vldapi.cpp
src/vldheap.cpp
src/vld_hooks.cpp
src/callstack.h
src/criticalsection.h
src/crtmfcpatch.h
src/dbghelp.h
src/map.h
src/ntapi.h
src/resource.h
src/set.h
setup/version.h
src/stdafx.h
src/tree.h
src/utility.h
src/vld.h
src/vldallocator.h
src/vldheap.h
src/vldint.h
src/vld_def.h
src/vld.natvis
src/vld.rc
)
if (CMAKE_VS_PLATFORM_NAME STREQUAL "Win32")
target_sources(vld PRIVATE src/vld.dll.dependency.x86.manifest)
endif()
if (CMAKE_VS_PLATFORM_NAME STREQUAL "x64")
target_sources(vld PRIVATE src/vld.dll.dependency.x64.manifest)
endif()
target_include_directories(vld INTERFACE src)
target_compile_options(vld PRIVATE $<$<CONFIG:Release>:/Ot /GT /GF /Gy->)
enable_testing()
add_subdirectory(lib/gtest gtest)
add_subdirectory(src/tests tests)