[CMake] Use WEBKIT_EXECUTABLE in MallocBench
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 May 2020 23:35:11 +0000 (23:35 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 May 2020 23:35:11 +0000 (23:35 +0000)
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: https://svn.webkit.org/repository/webkit/trunk@261444 268f45cc-cd09-0410-ab3c-d52691b4dbfc

CMakeLists.txt
ChangeLog
PerformanceTests/CMakeLists.txt
PerformanceTests/ChangeLog
PerformanceTests/MallocBench/MallocBench/CMakeLists.txt
Source/bmalloc/CMakeLists.txt
Source/bmalloc/ChangeLog

index a3e3c67..0478d0c 100644 (file)
@@ -191,11 +191,7 @@ if (ENABLE_TOOLS)
     add_subdirectory(Tools)
 endif ()
 
-if ("${PORT}" STREQUAL "GTK" OR "${PORT}" STREQUAL "WPE")
-    if (DEVELOPER_MODE)
-        add_subdirectory(PerformanceTests)
-    endif ()
-else ()
+if (DEVELOPER_MODE)
     add_subdirectory(PerformanceTests)
 endif ()
 
index 27ebb5b..1073e8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-05-09  Don Olmstead  <don.olmstead@sony.com>
+
+        [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:
+
 2020-05-07  Philippe Normand  <pnormand@igalia.com>
 
         [WPE][Qt] Enable by default
index 4322d2a..6dd185d 100644 (file)
@@ -1,8 +1,10 @@
 # MallocBench requires malloc_trim for non-Apple platforms
-if (NOT USE_SYSTEM_MALLOC AND (APPLE OR HAVE_MALLOC_TRIM))
-    add_subdirectory(MallocBench)
-else ()
-    message(WARNING "MallocBench is not available on this platform")
+if (NOT USE_SYSTEM_MALLOC)
+    if (APPLE OR HAVE_MALLOC_TRIM)
+        add_subdirectory(MallocBench)
+    else ()
+        message(WARNING "MallocBench is not available on this platform")
+    endif ()
 endif ()
 
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
index 71e6a53..4bdd1f7 100644 (file)
@@ -1,3 +1,17 @@
+2020-05-09  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use WEBKIT_EXECUTABLE in MallocBench
+        https://bugs.webkit.org/show_bug.cgi?id=211665
+
+        Reviewed by Yusuke Suzuki.
+
+        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:
+
 2020-05-08  Darin Adler  <darin@apple.com>
 
         Remove no-longer-used PerformanceTests/StitchMarker
index 12be644..fdb8485 100644 (file)
@@ -1,8 +1,4 @@
-add_library(sysmalloc SHARED mbmalloc.cpp)
-set_target_properties(sysmalloc PROPERTIES OUTPUT_NAME "mbmalloc")
-set_target_properties(sysmalloc PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/system/)
-
-set(MALLOC_BENCH_SOURCES
+set(MallocBench_SOURCES
     Benchmark.cpp
     CPUCount.cpp
     CommandLine.cpp
@@ -28,32 +24,20 @@ set(MALLOC_BENCH_SOURCES
     tree.cpp
 )
 
-set(MALLOC_BENCH_INCLUDE_DIRECTORIES
-    "${BMALLOC_DIR}"
-    "${CMAKE_BINARY_DIR}"
-    "${DERIVED_SOURCES_DIR}"
-    "${THIRDPARTY_DIR}"
+set(MallocBench_PRIVATE_INCLUDE_DIRECTORIES
+    ${CMAKE_BINARY_DIR}
+    ${bmalloc_FRAMEWORK_HEADERS_DIR}
 )
 
-set(MALLOC_BENCH_LIBRARIES
+set(MallocBench_PRIVATE_LIBRARIES
     ${CMAKE_DL_LIBS}
+    Threads::Threads
+    mbmalloc
 )
 
-WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
-
-WEBKIT_WRAP_SOURCELIST(${MALLOC_BENCH_SOURCES})
-
-
-include_directories(${MALLOC_BENCH_INCLUDE_DIRECTORIES})
+set(MallocBench_DEPENDENCIES sysmalloc)
 
-SET(CMAKE_SKIP_BUILD_RPATH  TRUE)
-if (DEVELOPER_MODE)
-    add_executable(MallocBench ${MALLOC_BENCH_SOURCES})
-    target_link_libraries(MallocBench ${MALLOC_BENCH_LIBRARIES} Threads::Threads mbmalloc)
-    add_dependencies(MallocBench sysmalloc mbmalloc)
-endif ()
-
-set(MALLOC_BENCH_OPS
+set(MallocBench_OPS
     facebook.ops
     flickr.ops
     flickr_memory_warning.ops
@@ -64,8 +48,19 @@ set(MALLOC_BENCH_OPS
     theverge_memory_warning.ops
 )
 
+WEBKIT_EXECUTABLE_DECLARE(MallocBench)
+WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
+
+set(CMAKE_SKIP_BUILD_RPATH ON)
+add_library(sysmalloc SHARED mbmalloc.cpp)
+set_target_properties(sysmalloc PROPERTIES OUTPUT_NAME "mbmalloc")
+set_target_properties(sysmalloc PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/system/)
+
 file(COPY
-    ${MALLOC_BENCH_OPS}
+    ${MallocBench_OPS}
     DESTINATION
     ${PROJECT_BINARY_DIR}
 )
+
+WEBKIT_WRAP_SOURCELIST(${MallocBench_SOURCES})
+WEBKIT_EXECUTABLE(MallocBench)
index 5522a84..a20d62e 100644 (file)
@@ -157,7 +157,8 @@ WEBKIT_WRAP_SOURCELIST(${bmalloc_SOURCES})
 WEBKIT_FRAMEWORK(bmalloc)
 WEBKIT_FRAMEWORK_TARGET(bmalloc)
 
-if (DEVELOPER_MODE)
+# Only build mbmalloc on platforms that MallocBench supports
+if (DEVELOPER_MODE AND (APPLE OR HAVE_MALLOC_TRIM))
     add_library(mbmalloc SHARED bmalloc/mbmalloc.cpp)
     target_include_directories(mbmalloc PRIVATE ${bmalloc_PRIVATE_INCLUDE_DIRECTORIES})
     target_link_libraries(mbmalloc Threads::Threads bmalloc)
index 4171232..c78567c 100644 (file)
@@ -1,3 +1,14 @@
+2020-05-09  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use WEBKIT_EXECUTABLE in MallocBench
+        https://bugs.webkit.org/show_bug.cgi?id=211665
+
+        Reviewed by Yusuke Suzuki.
+
+        Only build mbmalloc if its possible to run MallocBench.
+
+        * CMakeLists.txt:
+
 2020-05-08  Basuke Suzuki  <basuke.suzuki@sony.com>
 
         [WTF] Share Linux's MemoryPressureHandler among other Unix ports