@@ -76,9 +76,8 @@ set(WAKAAMA_WITH_CONNECTION_IMPLEMENTATION
76
76
)
77
77
set_property (CACHE WAKAAMA_WITH_CONNECTION_IMPLEMENTATION PROPERTY STRINGS NONE PLAIN TINYDTLS TESTING)
78
78
79
- # Set the defines for logging configuration
80
- function (set_defines target )
81
- # Mode
79
+ # Set mode related defines for target
80
+ function (set_defines_for_mode target )
82
81
if (WAKAAMA_MODE_CLIENT)
83
82
target_compile_definitions (${target} PUBLIC LWM2M_CLIENT_MODE)
84
83
endif ()
@@ -88,17 +87,21 @@ function(set_defines target)
88
87
if (WAKAAMA_MODE_BOOTSTRAP_SERVER)
89
88
target_compile_definitions (${target} PUBLIC LWM2M_BOOTSTRAP_SERVER_MODE)
90
89
endif ()
90
+ endfunction ()
91
91
92
- # Client
92
+ # Set client related defines for target
93
+ function (set_defines_for_client target )
93
94
if (WAKAAMA_CLIENT_INITIATED_BOOTSTRAP)
94
95
target_compile_definitions (${target} PUBLIC LWM2M_BOOTSTRAP)
95
96
endif ()
96
97
97
98
if (WAKAAMA_CLIENT_LWM2M_V_1_0)
98
99
target_compile_definitions (${target} PUBLIC LWM2M_VERSION_1_0)
99
100
endif ()
101
+ endfunction ()
100
102
101
- # Data Types
103
+ # Set data types related defines for target
104
+ function (set_defines_for_datatypes target )
102
105
if (WAKAMA_DATA_TLV)
103
106
target_compile_definitions (${target} PUBLIC LWM2M_SUPPORT_TLV)
104
107
endif ()
@@ -117,15 +120,19 @@ function(set_defines target)
117
120
if (WAKAAMA_DATA_OLD_CONTENT_FORMAT)
118
121
target_compile_definitions (${target} PUBLIC LWM2M_OLD_CONTENT_FORMAT_SUPPORT)
119
122
endif ()
123
+ endfunction ()
120
124
121
- # CoAP
125
+ # Set CoAP related defines for target
126
+ function (set_defines_for_coap target )
122
127
if (WAKAAMA_RAW_BLOCK1_REQUESTS)
123
128
target_compile_definitions (${target} PUBLIC LWM2M_RAW_BLOCK1_REQUESTS)
124
129
endif ()
125
130
126
131
target_compile_definitions (${target} PUBLIC LWM2M_COAP_DEFAULT_BLOCK_SIZE=${WAKAAMA_COAP_DEFAULT_BLOCK_SIZE} )
132
+ endfunction ()
127
133
128
- # Logging
134
+ # Set logging related defines for target
135
+ function (set_defines_for_logging target )
129
136
target_compile_definitions (${target} PUBLIC LWM2M_LOG_LEVEL=LWM2M_${WAKAAMA_LOG_LEVEL} )
130
137
131
138
if (WAKAAMA_LOG_CUSTOM_HANDLER)
@@ -135,6 +142,19 @@ function(set_defines target)
135
142
target_compile_definitions (${target} PUBLIC LWM2M_LOG_MAX_MSG_TXT_SIZE=${WAKAAMA_LOG_MAX_MSG_TXT_SIZE} )
136
143
endfunction ()
137
144
145
+ # Set the relevant defines for target
146
+ function (set_defines target )
147
+ set_defines_for_mode(target )
148
+
149
+ set_defines_for_client(target )
150
+
151
+ set_defines_for_datatypes(target )
152
+
153
+ set_defines_for_coap(target )
154
+
155
+ set_defines_for_logging(target )
156
+ endfunction ()
157
+
138
158
# Add data format source files to an existing target.
139
159
#
140
160
# Separated from target_sources_wakaama() for testability reasons.
0 commit comments