-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
83 lines (68 loc) · 2.49 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
cmake_minimum_required (VERSION 3.16)
project(ntldd
VERSION 0.2.0
DESCRIPTION "small utility will do the one thing that most people want from ldd")
#---------------------------------------------------------------------
option (DEBUG "Compile with debug symbols." OFF)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set (DEBUG ON)
endif ()
if (NOT DEBUG)
set (RELEASE ON)
set (NDEBUG ON)
else ()
set (DEBUG ON)
set (_DEBUG ON)
set (RELEASE OFF)
endif ()
option (VERBOSE "Verbose console output." OFF)
if (VERBOSE)
set (CMAKE_VERBOSE_MAKEFILE ON)
endif ()
#---------------------------------------------------------------------
add_executable(ntldd libntldd.c
ntldd.c)
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/libntldd.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/libntldd.h")
add_definitions("-D__USE_MINGW_ANSI_STDIO=1"
"-D_WIN32_WINNT=0x501")
if (NOT MSVC)
add_definitions("--pedantic")
target_compile_options (ntldd PRIVATE "-Wno-missing-braces"
"-fno-common"
"-Wall")
if (DEBUG)
target_compile_options (ntldd PRIVATE #"-Wno-bool-compare"
#"-Wno-incompatible-pointer-types"
"-Wno-unused-parameter"
#"-Wno-unused-variable"
"-Wno-int-to-pointer-cast"
"-Wno-unused-function"
"-Wno-format")
endif ()
endif ()
if (DEBUG)
message (STATUS "Compiling with DEBUG symbols")
if (NOT MSVC)
add_definitions (-g
#-Wall
#-Werror
#-Wfatal-errors
-fdiagnostics-show-option
-fmax-errors=3)
else ()
add_definitions ("-Zi")
endif ()
else ()
if (NOT MSVC)
target_compile_options (ntldd PRIVATE "-O3"
"-c"
"-s")
else ()
target_compile_options (ntldd PRIVATE "-Ox"
"-GF"
"-c"
"-W2"
"-GL")
endif ()
endif ()
target_link_libraries(ntldd "imagehlp")