2016-05-12 04:36:12 +08:00
|
|
|
---
|
|
|
|
title: Build Options
|
2016-05-26 01:54:28 +08:00
|
|
|
items:
|
|
|
|
- { type: file, name: enabling-flags.md }
|
|
|
|
- { type: file, name: disabling-flags.md }
|
|
|
|
- { type: file, name: platform-spec.md }
|
|
|
|
- { type: file, name: tunables.md }
|
2016-05-12 04:36:12 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
Mongoose source code ships in a single .c file that contains functionality
|
|
|
|
for all supported protocols (modules). Modules can be disabled at compile
|
2016-07-21 22:30:01 +08:00
|
|
|
time which reduces the executable's size. That can be done by setting preprocessor
|
2016-05-12 04:36:12 +08:00
|
|
|
flags. Also, some preprocessor flags can be used to tune internal Mongoose
|
|
|
|
parameters.
|
|
|
|
|
2016-07-21 22:30:01 +08:00
|
|
|
To set a preprocessor flag during compile time, use the `-D <PREPROCESSOR_FLAG>`
|
|
|
|
compiler option. For example, to disable both MQTT and CoAP,
|
2016-05-12 04:36:12 +08:00
|
|
|
compile the application `my_app.c` like this (assumed UNIX system):
|
|
|
|
|
|
|
|
```
|
2016-07-01 19:32:34 +08:00
|
|
|
$ cc my_app.c mongoose.c -D MG_DISABLE_MQTT -D MG_DISABLE_COAP
|
2016-05-12 04:36:12 +08:00
|
|
|
```
|