-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathProjectConfig.cmake
89 lines (77 loc) · 3.04 KB
/
ProjectConfig.cmake
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# set LOG_USE_COLOR
if((${PROJECT_TARGET} STREQUAL "TARGET_RT1051"))
set (LOG_USE_COLOR 0 CACHE INTERNAL "")
else()
set (LOG_USE_COLOR 1 CACHE INTERNAL "")
endif()
set(ASSETS_TYPE "Proprietary" CACHE INTERNAL "")
if (NOT ${ASSETS_TYPE} STREQUAL "Proprietary" AND NOT ${ASSETS_TYPE} STREQUAL "Community")
message(FATAL_ERROR " Unknown ASSETS_TYPE value: ${ASSETS_TYPE} - allowed values: Proprietary, Community")
endif()
# add LOG_SENSITIVE_DATA enable option
option(LOG_SENSITIVE_DATA "LOG_SENSITIVE_DATA" ON)
if (${LOG_SENSITIVE_DATA} STREQUAL "ON")
set (LOG_SENSITIVE_DATA_ENABLED 1 CACHE INTERNAL "")
else()
set (LOG_SENSITIVE_DATA_ENABLED 0 CACHE INTERNAL "")
endif()
# add SystemView enable option
option(SYSTEMVIEW "SYSTEMVIEW" OFF)
if((${PROJECT_TARGET} STREQUAL "TARGET_RT1051") AND (${SYSTEMVIEW} STREQUAL "ON"))
set (SYSTEM_VIEW_ENABLED 1 CACHE INTERNAL "")
set (LOG_REDIRECT "RTT_SYSTEMVIEW" CACHE INTERNAL "")
else()
set (SYSTEMVIEW 0FF CACHE INTERNAL "")
set (SYSTEM_VIEW_ENABLED 0 CACHE INTERNAL "")
set (LOG_REDIRECT "RTT_JLINK" CACHE INTERNAL "")
endif()
option(SYSTEM_PROFILE "SYSTEM_PROFILE" OFF)
if(${SYSTEM_PROFILE} STREQUAL "ON")
set(PROF_ON 1 CACHE INTERNAL "")
else()
set(PROF_ON 0 CACHE INTERNAL "")
endif()
# add CurrentMeasurement enable option
option(CURRENT_MEASUREMENT "CURRENT_MEASUREMENT" OFF)
# add USB-CDC echo test enable option
option(USBCDC_ECHO "USBCDC_ECHO" OFF)
if (${USBCDC_ECHO} STREQUAL "ON")
set (USBCDC_ECHO_ENABLED 1 CACHE INTERNAL "")
else()
set (USBCDC_ECHO_ENABLED 0 CACHE INTERNAL "")
endif()
#add Debug LUART enable option
if (${LOG_REDIRECT} STREQUAL "RTT_LUART")
set (LOG_LUART_ENABLED 1 CACHE INTERNAL "")
else()
set (LOG_LUART_ENABLED 0 CACHE INTERNAL "")
endif()
# Config option for the lwext4
# LWEXT4 debug options
option(LWEXT4_DEBUG_PRINTF "LWEXT4 debug printf enable" ON)
option(LWEXT4_DEBUG_ASSERT "LWEXT4 assert printf enable" OFF)
# LWEXT4 sectors cache size
set(LWEXT4_CACHE_SIZE 256 CACHE INTERNAL "")
# add Development Configuration option
option(WITH_DEVELOPMENT_FEATURES "Include development features" OFF)
set(DEVELOPER_SETTINGS_OPTIONS_DEFAULT ${WITH_DEVELOPMENT_FEATURES} CACHE INTERNAL "")
set(ENABLE_DEVELOPER_MODE_ENDPOINT_DEFAULT ${WITH_DEVELOPMENT_FEATURES} CACHE INTERNAL "")
if (${WITH_DEVELOPMENT_FEATURES} STREQUAL "ON")
set (LOG_SENSITIVE_DATA_ENABLED 1 CACHE INTERNAL "")
endif()
# Enable/disable USB MTP
option(ENABLE_USB_MTP "Enables usage of USB MTP" OFF)
# add Mudita USB Vendor/Product IDs
option(MUDITA_USB_ID "Enables using Mudita registered USB Vendor ID and Pure Phone USB Product ID" ON)
# Config options described in README.md
set(PROJECT_CONFIG_DEFINITIONS
LOG_USE_COLOR=${LOG_USE_COLOR}
LOG_SENSITIVE_DATA_ENABLED=${LOG_SENSITIVE_DATA_ENABLED}
LOG_REDIRECT=${LOG_REDIRECT}
SYSTEM_VIEW_ENABLED=${SYSTEM_VIEW_ENABLED}
USBCDC_ECHO_ENABLED=${USBCDC_ECHO_ENABLED}
LOG_LUART_ENABLED=${LOG_LUART_ENABLED}
MAGIC_ENUM_RANGE_MAX=256
PROF_ON=${PROF_ON}
CACHE INTERNAL ""
)