[Linux] Port MallocBench
[WebKit-https.git] / PerformanceTests / MallocBench / MallocBench / CMakeLists.txt
1 add_library(sysmalloc SHARED mbmalloc.cpp)
2 set_target_properties(sysmalloc PROPERTIES OUTPUT_NAME "mbmalloc")
3 set_target_properties(sysmalloc PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/system/)
4
5 set(MALLOC_BENCH_SOURCES
6     Benchmark.cpp
7     CPUCount.cpp
8     CommandLine.cpp
9     Interpreter.cpp
10     Memory.cpp
11     alloc_free.cpp
12     balloon.cpp
13     big.cpp
14     churn.cpp
15     facebook.cpp
16     flickr.cpp
17     fragment.cpp
18     list.cpp
19     main.cpp
20     medium.cpp
21     message.cpp
22     nimlang.cpp
23     realloc.cpp
24     reddit.cpp
25     stress.cpp
26     stress_aligned.cpp
27     theverge.cpp
28     tree.cpp
29 )
30
31 set(MALLOC_BENCH_INCLUDE_DIRECTORIES
32     "${BMALLOC_DIR}"
33     "${CMAKE_BINARY_DIR}"
34     "${DERIVED_SOURCES_DIR}"
35     "${THIRDPARTY_DIR}"
36 )
37
38 set(MALLOC_BENCH_LIBRARIES
39     ${CMAKE_DL_LIBS}
40 )
41
42 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
43
44 WEBKIT_WRAP_SOURCELIST(${MALLOC_BENCH_SOURCES})
45
46
47 include_directories(${MALLOC_BENCH_INCLUDE_DIRECTORIES})
48
49 SET(CMAKE_SKIP_BUILD_RPATH  TRUE)
50 add_executable(MallocBench ${MALLOC_BENCH_SOURCES})
51 target_link_libraries(MallocBench ${CMAKE_THREAD_LIBS_INIT} ${MALLOC_BENCH_LIBRARIES} mbmalloc)
52 add_dependencies(MallocBench sysmalloc mbmalloc)
53
54 set(MALLOC_BENCH_OPS
55     facebook.ops
56     flickr.ops
57     flickr_memory_warning.ops
58     nimlang.ops
59     reddit.ops
60     reddit_memory_warning.ops
61     theverge.ops
62     theverge_memory_warning.ops
63 )
64
65 file(COPY
66     ${MALLOC_BENCH_OPS}
67     DESTINATION
68     ${PROJECT_BINARY_DIR}
69 )