[cmake] Deduplicated bmalloc/Zone.cpp handling.
[WebKit-https.git] / Source / bmalloc / CMakeLists.txt
1 set_property(DIRECTORY . PROPERTY FOLDER "bmalloc")
2
3 set(bmalloc_INCLUDE_DIRECTORIES
4     "${BMALLOC_DIR}"
5 )
6
7 set(bmalloc_SOURCES
8     bmalloc/Allocator.cpp
9     bmalloc/Cache.cpp
10     bmalloc/Deallocator.cpp
11     bmalloc/Environment.cpp
12     bmalloc/Heap.cpp
13     bmalloc/Logging.cpp
14     bmalloc/ObjectType.cpp
15     bmalloc/StaticMutex.cpp
16     bmalloc/VMHeap.cpp
17     bmalloc/XLargeMap.cpp
18     bmalloc/mbmalloc.cpp
19 )
20
21 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
22     list(APPEND bmalloc_SOURCES
23         bmalloc/Zone.cpp
24     )
25 endif ()
26
27 set(bmalloc_LIBRARIES
28     ${CMAKE_DL_LIBS}
29 )
30
31 WEBKIT_WRAP_SOURCELIST(${bmalloc_SOURCES})
32 include_directories(${bmalloc_INCLUDE_DIRECTORIES})
33 add_library(bmalloc STATIC ${bmalloc_SOURCES})
34 target_link_libraries(bmalloc ${bmalloc_LIBRARIES})
35 set_target_properties(bmalloc PROPERTIES COMPILE_DEFINITIONS "BUILDING_bmalloc")