Skip to content

Commit 0183c33

Browse files
[CMake] Use WEBKIT_EXECUTABLE in MallocBench
https://bugs.webkit.org/show_bug.cgi?id=211665 Reviewed by Yusuke Suzuki. .: Add the PerformanceTest subdirectory for all ports when in DEVELOPER_MODE. * CMakeLists.txt: PerformanceTests: Cleanup MallocBench definitions using WEBKIT_EXECUTABLE. Notify developers that MallocBench is unavailable only if bmalloc is being used but the platform does not have the functionality required. * CMakeLists.txt: * MallocBench/MallocBench/CMakeLists.txt: Source/bmalloc: Only build mbmalloc if its possible to run MallocBench. * CMakeLists.txt: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@261444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 514219a commit 0183c33

File tree

7 files changed

+66
-36
lines changed

7 files changed

+66
-36
lines changed

CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,7 @@ if (ENABLE_TOOLS)
191191
add_subdirectory(Tools)
192192
endif ()
193193

194-
if ("${PORT}" STREQUAL "GTK" OR "${PORT}" STREQUAL "WPE")
195-
if (DEVELOPER_MODE)
196-
add_subdirectory(PerformanceTests)
197-
endif ()
198-
else ()
194+
if (DEVELOPER_MODE)
199195
add_subdirectory(PerformanceTests)
200196
endif ()
201197

ChangeLog

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2020-05-09 Don Olmstead <[email protected]>
2+
3+
[CMake] Use WEBKIT_EXECUTABLE in MallocBench
4+
https://bugs.webkit.org/show_bug.cgi?id=211665
5+
6+
Reviewed by Yusuke Suzuki.
7+
8+
Add the PerformanceTest subdirectory for all ports when in DEVELOPER_MODE.
9+
10+
* CMakeLists.txt:
11+
112
2020-05-07 Philippe Normand <[email protected]>
213

314
[WPE][Qt] Enable by default

PerformanceTests/CMakeLists.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# MallocBench requires malloc_trim for non-Apple platforms
2-
if (NOT USE_SYSTEM_MALLOC AND (APPLE OR HAVE_MALLOC_TRIM))
3-
add_subdirectory(MallocBench)
4-
else ()
5-
message(WARNING "MallocBench is not available on this platform")
2+
if (NOT USE_SYSTEM_MALLOC)
3+
if (APPLE OR HAVE_MALLOC_TRIM)
4+
add_subdirectory(MallocBench)
5+
else ()
6+
message(WARNING "MallocBench is not available on this platform")
7+
endif ()
68
endif ()
79

810
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()

PerformanceTests/ChangeLog

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2020-05-09 Don Olmstead <[email protected]>
2+
3+
[CMake] Use WEBKIT_EXECUTABLE in MallocBench
4+
https://bugs.webkit.org/show_bug.cgi?id=211665
5+
6+
Reviewed by Yusuke Suzuki.
7+
8+
Cleanup MallocBench definitions using WEBKIT_EXECUTABLE. Notify developers
9+
that MallocBench is unavailable only if bmalloc is being used but the platform
10+
does not have the functionality required.
11+
12+
* CMakeLists.txt:
13+
* MallocBench/MallocBench/CMakeLists.txt:
14+
115
2020-05-08 Darin Adler <[email protected]>
216

317
Remove no-longer-used PerformanceTests/StitchMarker
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
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
1+
set(MallocBench_SOURCES
62
Benchmark.cpp
73
CPUCount.cpp
84
CommandLine.cpp
@@ -28,32 +24,20 @@ set(MALLOC_BENCH_SOURCES
2824
tree.cpp
2925
)
3026

31-
set(MALLOC_BENCH_INCLUDE_DIRECTORIES
32-
"${BMALLOC_DIR}"
33-
"${CMAKE_BINARY_DIR}"
34-
"${DERIVED_SOURCES_DIR}"
35-
"${THIRDPARTY_DIR}"
27+
set(MallocBench_PRIVATE_INCLUDE_DIRECTORIES
28+
${CMAKE_BINARY_DIR}
29+
${bmalloc_FRAMEWORK_HEADERS_DIR}
3630
)
3731

38-
set(MALLOC_BENCH_LIBRARIES
32+
set(MallocBench_PRIVATE_LIBRARIES
3933
${CMAKE_DL_LIBS}
34+
Threads::Threads
35+
mbmalloc
4036
)
4137

42-
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
43-
44-
WEBKIT_WRAP_SOURCELIST(${MALLOC_BENCH_SOURCES})
45-
46-
47-
include_directories(${MALLOC_BENCH_INCLUDE_DIRECTORIES})
38+
set(MallocBench_DEPENDENCIES sysmalloc)
4839

49-
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
50-
if (DEVELOPER_MODE)
51-
add_executable(MallocBench ${MALLOC_BENCH_SOURCES})
52-
target_link_libraries(MallocBench ${MALLOC_BENCH_LIBRARIES} Threads::Threads mbmalloc)
53-
add_dependencies(MallocBench sysmalloc mbmalloc)
54-
endif ()
55-
56-
set(MALLOC_BENCH_OPS
40+
set(MallocBench_OPS
5741
facebook.ops
5842
flickr.ops
5943
flickr_memory_warning.ops
@@ -64,8 +48,19 @@ set(MALLOC_BENCH_OPS
6448
theverge_memory_warning.ops
6549
)
6650

51+
WEBKIT_EXECUTABLE_DECLARE(MallocBench)
52+
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
53+
54+
set(CMAKE_SKIP_BUILD_RPATH ON)
55+
add_library(sysmalloc SHARED mbmalloc.cpp)
56+
set_target_properties(sysmalloc PROPERTIES OUTPUT_NAME "mbmalloc")
57+
set_target_properties(sysmalloc PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/system/)
58+
6759
file(COPY
68-
${MALLOC_BENCH_OPS}
60+
${MallocBench_OPS}
6961
DESTINATION
7062
${PROJECT_BINARY_DIR}
7163
)
64+
65+
WEBKIT_WRAP_SOURCELIST(${MallocBench_SOURCES})
66+
WEBKIT_EXECUTABLE(MallocBench)

Source/bmalloc/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ WEBKIT_WRAP_SOURCELIST(${bmalloc_SOURCES})
157157
WEBKIT_FRAMEWORK(bmalloc)
158158
WEBKIT_FRAMEWORK_TARGET(bmalloc)
159159

160-
if (DEVELOPER_MODE)
160+
# Only build mbmalloc on platforms that MallocBench supports
161+
if (DEVELOPER_MODE AND (APPLE OR HAVE_MALLOC_TRIM))
161162
add_library(mbmalloc SHARED bmalloc/mbmalloc.cpp)
162163
target_include_directories(mbmalloc PRIVATE ${bmalloc_PRIVATE_INCLUDE_DIRECTORIES})
163164
target_link_libraries(mbmalloc Threads::Threads bmalloc)

Source/bmalloc/ChangeLog

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2020-05-09 Don Olmstead <[email protected]>
2+
3+
[CMake] Use WEBKIT_EXECUTABLE in MallocBench
4+
https://bugs.webkit.org/show_bug.cgi?id=211665
5+
6+
Reviewed by Yusuke Suzuki.
7+
8+
Only build mbmalloc if its possible to run MallocBench.
9+
10+
* CMakeLists.txt:
11+
112
2020-05-08 Basuke Suzuki <[email protected]>
213

314
[WTF] Share Linux's MemoryPressureHandler among other Unix ports

0 commit comments

Comments
 (0)