-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
46 lines (37 loc) · 1.28 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
cmake_minimum_required(VERSION 3.1.0)
project(wlib-malloc)
set(CMAKE_CXX_STANDARD 11)
set(WLIB_TLSF_DIR ${CMAKE_CURRENT_LIST_DIR}/.wio/node_modules/wlib-tlsf)
set(WLIB_TLSF_INCLUDE_DIR ${WLIB_TLSF_DIR}/include)
set(WLIB_TLSF_SRC ${WLIB_TLSF_DIR}/src)
file(GLOB_RECURSE WLIB_TLSF_FILES ${WLIB_TLSF_SRC}/* ${WLIB_TLSF_INCLUDE_DIR}/*)
add_library(wlib-tlsf ${WLIB_TLSF_FILES})
target_include_directories(wlib-tlsf PRIVATE ${WLIB_TLSF_INCLUDE_DIR})
target_compile_definitions(wlib-tlsf PRIVATE
WLIB_TLSF_64BIT
WLIB_TLSF_LOG2_ALIGN=3
WLIB_TLSF_LOG2_DIV=3
WLIB_TLSF_LOG2_MAX=13
WLIB_TLSF_DEBUG_LEVEL=1
)
set(WLIB_MALLOC_DIR ${CMAKE_CURRENT_LIST_DIR})
set(WLIB_MALLOC_INCLUDE_DIR ${WLIB_MALLOC_DIR}/include)
set(WLIB_MALLOC_SRC ${WLIB_MALLOC_DIR}/src)
file(GLOB_RECURSE WLIB_MALLOC_FILES
${WLIB_MALLOC_SRC}/*.cpp
${WLIB_MALLOC_SRC}/*.h
${WLIB_MALLOC_INCLUDE_DIR}/*
)
add_library(wlib-malloc ${WLIB_MALLOC_FILES})
target_include_directories(wlib-malloc PRIVATE
${WLIB_MALLOC_INCLUDE_DIR}
${WLIB_TLSF_INCLUDE_DIR}
)
target_link_libraries(wlib-malloc wlib-tlsf)
file(GLOB_RECURSE TEST_FILES
unit/*.h
unit/*.cpp
)
add_executable(unit ${TEST_FILES})
target_link_libraries(unit wlib-malloc)
target_include_directories(unit PRIVATE ${WLIB_MALLOC_INCLUDE_DIR})