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
add_library(log STATIC)
add_subdirectory(api)
add_subdirectory(board)
add_subdirectory(logdump)
target_sources(log
PRIVATE
Logger.cpp
log.cpp
LoggerBuffer.cpp
LoggerWorker.cpp
StringCircularBuffer.cpp
)
target_include_directories(log PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(log
PRIVATE
utility
purefs-paths
crashdump-metadata-store
Microsoft.GSL::GSL
PUBLIC
module-os
log-api
utils-rotator
sys-service
)
if(${PROJECT_TARGET} STREQUAL "TARGET_RT1051")
if(${PRODUCT} STREQUAL "PurePhone")
set(CIRCULAR_BUFFER_SIZE 1024)
elseif(${PRODUCT} STREQUAL "BellHybrid")
set(CIRCULAR_BUFFER_SIZE 512)
else()
message(FATAL_ERROR "Unknown product: ${PRODUCT}")
endif()
elseif (${PROJECT_TARGET} STREQUAL "TARGET_Linux")
set(CIRCULAR_BUFFER_SIZE 1024)
else()
message(FATAL_ERROR "Unknown target: ${PROJECT_TARGET}")
endif()
target_compile_definitions(log
PUBLIC
LOGGER_CIRCULAR_BUFFER_SIZE=${CIRCULAR_BUFFER_SIZE}
)
if (${ENABLE_TESTS})
add_subdirectory(tests)
endif()