Skip to content

Commit c205387

Browse files
committed
Add CMakeBuild config for memory-analyzer
This commit adds the required files for the CMakeBuild system to build and generate the memory-analyzer
1 parent 21b43b4 commit c205387

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ set_target_properties(
6868
json
6969
langapi
7070
linking
71+
memory-analyzer
72+
memory-analyzer-lib
7173
miniBDD
7274
pointer-analysis
7375
solvers

src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ add_subdirectory(jsil)
9191
add_subdirectory(json)
9292
add_subdirectory(langapi)
9393
add_subdirectory(linking)
94-
add_subdirectory(memory-analyzer)
95-
add_subdirectory(memory-models)
9694
add_subdirectory(pointer-analysis)
9795
add_subdirectory(solvers)
9896
add_subdirectory(util)
@@ -103,3 +101,4 @@ add_subdirectory(goto-cc)
103101
add_subdirectory(goto-instrument)
104102
add_subdirectory(goto-analyzer)
105103
add_subdirectory(goto-diff)
104+
add_subdirectory(memory-analyzer)

src/memory-analyzer/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Library
2+
file(GLOB_RECURSE sources "*.cpp" "*.h")
3+
list(REMOVE_ITEM sources
4+
${CMAKE_CURRENT_SOURCE_DIR}/memory-analyzer_main.cpp
5+
)
6+
add_library(memory-analyzer-lib ${sources})
7+
8+
generic_includes(memory-analyzer-lib)
9+
10+
target_link_libraries(memory-analyzer-lib
11+
ansi-c
12+
goto-programs
13+
util
14+
)
15+
16+
17+
# Executable
18+
add_executable(memory-analyzer memory_analyzer_main.cpp)
19+
target_link_libraries(memory-analyzer memory-analyzer-lib)

unit/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
2+
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR
3+
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"
4+
)
5+
# private is overwritten in the gdb_api test cases
6+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-keyword-macro")
7+
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
8+
# This would be the place to enable warnings for Windows builds, although
9+
# config.inc doesn't seem to do that currently
10+
endif()
11+
112
file(GLOB_RECURSE sources "*.cpp" "*.h")
213

314
file(GLOB_RECURSE testing_utils "testing-utils/*.cpp" "testing-utils/*.h")

0 commit comments

Comments
 (0)