-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
33 lines (25 loc) · 1.4 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
project(wlib)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS_DISTRIBUTION "-fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -g -Os -Wall -ffunction-sections -fdata-sections -flto")
set(CMAKE_C_FLAGS_DISTRIBUTION "-std=gnu11 -fno-fat-lto-objects -g -Os -Wall -ffunction-sections -fdata-sections -flto")
add_definitions(-I/${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
#[[
These definitions are used for how the memory is allocated
MAX_ALLOCATORS - Number of allocators (how many sizes of memory blocks)
NUM_BLOCKS - Number of block each allocator will contain
* Type of memory available. Available types:
* STATIC_POOL -> Static memory will be used and all the memory will be reserved at start
* DYNAMIC_POOL -> Dynamic memory will be used and all the memory will be reserved at start
* NO_POOL -> Dynamic memory will be used and Allocators will be expanded at run time
*
* If you don't define any of these then no memory will created at the beginning and
* memory will be expanded at run time
*/
]]
add_definitions(-DWLIB_DEBUG -DMAX_ALLOCATORS=10u -DNUM_BLOCKS=100u -DDYNAMIC_POOL)
file(GLOB_RECURSE header_files "wlib/*.h")
file(GLOB_RECURSE source_files "wlib/*.cpp" "wlib/*.cc")
set(HEADER_FILES ${header_files})
set(SOURCE_FILES ${source_files})
add_library(wlib STATIC ${SOURCE_FILES} ${HEADER_FILES})