forked from jemalloc/jemalloc
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
69 lines (60 loc) · 1.51 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
cmake_minimum_required(VERSION 3.14)
set (PROJECT_NAME FEX_jemalloc)
project(${PROJECT_NAME}
VERSION 5.2.1
LANGUAGES C CXX)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
cmake_policy(SET CMP0083 NEW) # Follow new PIE policy
include(CheckPIESupported)
check_pie_supported()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/pregen/include/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
set (SRCS
src/jemalloc.c
src/arena.c
src/background_thread.c
src/base.c
src/bin.c
src/bitmap.c
src/ckh.c
src/ctl.c
src/div.c
src/extent.c
src/extent_dss.c
src/extent_mmap.c
src/hash.c
src/hook.c
src/large.c
src/log.c
src/malloc_io.c
src/mutex.c
src/mutex_pool.c
src/nstime.c
src/pages.c
src/prng.c
src/prof.c
src/rtree.c
src/safety_check.c
src/stats.c
src/sc.c
src/sz.c
src/tcache.c
src/test_hooks.c
src/ticker.c
src/tsd.c
src/witness.c
src/jemalloc_cpp.cpp
)
function(AddLibrary Name Type)
add_library(${Name} ${Type} ${SRCS})
set_property(TARGET ${Name} PROPERTY C_STANDARD 11)
set_property(TARGET ${Name} PROPERTY CXX_STANDARD 17)
target_link_libraries(${Name} pthread)
set_target_properties(${Name} PROPERTIES OUTPUT_NAME FEX_jemalloc)
target_include_directories(${Name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/)
target_include_directories(${Name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/pregen/include/)
target_compile_definitions(${Name} PRIVATE -D_GNU_SOURCE -D_REENTRANT)
target_compile_options(${Name} PRIVATE -fvisibility=hidden)
endfunction()
AddLibrary(${PROJECT_NAME} OBJECT)