File tree Expand file tree Collapse file tree 6 files changed +61
-15
lines changed Expand file tree Collapse file tree 6 files changed +61
-15
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,15 @@ endfunction()
121121option (WITH_MEMORY_ANALYZER OFF
122122 "build the memory analyzer" )
123123
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+
124133add_subdirectory (src)
125134add_subdirectory (regression)
126135add_subdirectory (unit)
Original file line number Diff line number Diff line change @@ -30,6 +30,19 @@ DIRS = cbmc \
3030 symtab2gb \
3131 # Empty last line
3232
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+
3346ifeq ($(WITH_MEMORY_ANALYZER ) ,1)
3447 DIRS += memory-analyzer
3548endif
Original file line number Diff line number Diff line change @@ -106,6 +106,6 @@ add_subdirectory(goto-diff)
106106add_subdirectory (goto-harness)
107107add_subdirectory (symtab2gb)
108108
109- if (WITH_MEMORY_ANALYZER)
109+ if (UNIX OR WITH_MEMORY_ANALYZER)
110110add_subdirectory (memory-analyzer)
111111endif ()
Original file line number Diff line number Diff line change @@ -31,10 +31,21 @@ all: cbmc.dir \
3131 goto-diff.dir \
3232 goto-instrument.dir \
3333 goto-harness.dir \
34- memory-analyzer.dir \
3534 symtab2gb.dir \
3635 # Empty last line
3736
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+
3849# ##############################################################################
3950
4051util.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
67
78INCLUDES = -I ..
89
910LIBS = \
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 )
1617
17-
1818
19- CLEANFILES = memory-analyzer$(EXEEXT )
19+ CLEANFILES = memory-analyzer$(EXEEXT )
2020
2121include ../config.inc
2222include ../common
Original file line number Diff line number Diff line change @@ -84,6 +84,19 @@ SRC += analyses/ai/ai.cpp \
8484 util/unicode.cpp \
8585 # Empty last line
8686
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+
87100ifeq ($(WITH_MEMORY_ANALYZER ) ,1)
88101 SRC += memory-analyzer/gdb_api.cpp
89102endif
You can’t perform that action at this time.
0 commit comments