File tree 6 files changed +61
-15
lines changed 6 files changed +61
-15
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,15 @@ endfunction()
121
121
option (WITH_MEMORY_ANALYZER OFF
122
122
"build the memory analyzer" )
123
123
124
+ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
125
+ set (WITH_MEMORY_ANALYZER_DEFAULT ON )
126
+ else ()
127
+ set (WITH_MEMORY_ANALYZER_DEFAULT OFF )
128
+ endif ()
129
+
130
+ option (WITH_MEMORY_ANALYZER ${WITH_MEMORY_ANALYZER_DEFAULT}
131
+ "build the memory analyzer" )
132
+
124
133
add_subdirectory (src)
125
134
add_subdirectory (regression)
126
135
add_subdirectory (unit)
Original file line number Diff line number Diff line change @@ -30,6 +30,19 @@ DIRS = cbmc \
30
30
symtab2gb \
31
31
# Empty last line
32
32
33
+ ifeq ($(OS ) ,Windows_NT)
34
+ detected_OS := Windows
35
+ else
36
+ detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
37
+ endif
38
+
39
+ ifeq ($(detected_OS ) ,Linux)
40
+ ifneq ($(WITH_MEMORY_ANALYZER),0)
41
+ # only set if it wasn't explicitly unset
42
+ WITH_MEMORY_ANALYZER =1
43
+ endif
44
+ endif
45
+
33
46
ifeq ($(WITH_MEMORY_ANALYZER ) ,1)
34
47
DIRS += memory-analyzer
35
48
endif
Original file line number Diff line number Diff line change @@ -106,6 +106,6 @@ add_subdirectory(goto-diff)
106
106
add_subdirectory (goto-harness)
107
107
add_subdirectory (symtab2gb)
108
108
109
- if (WITH_MEMORY_ANALYZER)
109
+ if (UNIX OR WITH_MEMORY_ANALYZER)
110
110
add_subdirectory (memory-analyzer)
111
111
endif ()
Original file line number Diff line number Diff line change @@ -31,10 +31,21 @@ all: cbmc.dir \
31
31
goto-diff.dir \
32
32
goto-instrument.dir \
33
33
goto-harness.dir \
34
- memory-analyzer.dir \
35
34
symtab2gb.dir \
36
35
# Empty last line
37
36
37
+ ifeq ($(OS ) ,Windows_NT)
38
+ detected_OS := Windows
39
+ else
40
+ detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
41
+ endif
42
+
43
+ ifeq ($(detected_OS ) ,Linux)
44
+ all : memory-analyzer.dir
45
+ else ifeq ($(WITH_MEMORY_ANALYZER),1)
46
+ all : memory-analyzer.dir
47
+ endif
48
+
38
49
# ##############################################################################
39
50
40
51
util.dir : big-int.dir
Original file line number Diff line number Diff line change 1
- SRC = analyze_symbol.cpp\
2
- gdb_api.cpp \
3
- memory_analyzer_main.cpp \
4
- memory_analyzer_parse_options.cpp
5
- # Empty last line
1
+ SRC = \
2
+ analyze_symbol.cpp \
3
+ gdb_api.cpp \
4
+ memory_analyzer_main.cpp \
5
+ memory_analyzer_parse_options.cpp
6
+ # Empty last line
6
7
7
8
INCLUDES = -I ..
8
9
9
10
LIBS = \
10
- ../ansi-c/ansi-c$(LIBEXT ) \
11
- ../goto-programs/goto-programs$(LIBEXT ) \
12
- ../linking/linking$(LIBEXT ) \
13
- ../util/util$(LIBEXT ) \
14
- ../big-int/big-int$(LIBEXT ) \
15
- ../langapi/langapi$(LIBEXT )
11
+ ../ansi-c/ansi-c$(LIBEXT ) \
12
+ ../goto-programs/goto-programs$(LIBEXT ) \
13
+ ../linking/linking$(LIBEXT ) \
14
+ ../util/util$(LIBEXT ) \
15
+ ../big-int/big-int$(LIBEXT ) \
16
+ ../langapi/langapi$(LIBEXT )
16
17
17
-
18
18
19
- CLEANFILES = memory-analyzer$(EXEEXT )
19
+ CLEANFILES = memory-analyzer$(EXEEXT )
20
20
21
21
include ../config.inc
22
22
include ../common
Original file line number Diff line number Diff line change @@ -84,6 +84,19 @@ SRC += analyses/ai/ai.cpp \
84
84
util/unicode.cpp \
85
85
# Empty last line
86
86
87
+ ifeq ($(OS ) ,Windows_NT)
88
+ detected_OS := Windows
89
+ else
90
+ detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
91
+ endif
92
+
93
+ ifeq ($(detected_OS ) ,Linux)
94
+ ifneq ($(WITH_MEMORY_ANALYZER),0)
95
+ # only set if it wasn't explicitly unset
96
+ WITH_MEMORY_ANALYZER =1
97
+ endif
98
+ endif
99
+
87
100
ifeq ($(WITH_MEMORY_ANALYZER ) ,1)
88
101
SRC += memory-analyzer/gdb_api.cpp
89
102
endif
You can’t perform that action at this time.
0 commit comments