1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-09-29 21:20:11 +00:00

Refactored how CMake passes version & settings info

- keys can now be passed per-build passing -DLAIKA_PUBKEY=[pubkey] & -LAIKA_PRIVKEY=[pubkey] to `cmake -B`
- if those definitions aren't passed, the default public & private key will be used (for quick testing)
This commit is contained in:
2022-01-30 01:15:51 -06:00
parent 7481431551
commit 6fb8aa9b8a
8 changed files with 72 additions and 23 deletions

View File

@@ -16,22 +16,6 @@
#define LAIKA_DEBUG(...)
#endif
/* for intellisense */
#ifndef LAIKA_VERSION_MAJOR
#define LAIKA_VERSION_MAJOR 0
#endif
#ifndef LAIKA_VERSION_MINOR
#define LAIKA_VERSION_MINOR 0
#endif
/* for testing!! make sure you pass your generated keypair to cmake */
#ifndef LAIKA_PUBKEY
#define LAIKA_PUBKEY "997d026d1c65deb6c30468525132be4ea44116d6f194c142347b67ee73d18814"
#endif
#ifndef LAIKA_PRIVKEY
#define LAIKA_PRIVKEY "1dbd33962f1e170d1e745c6d3e19175049b5616822fac2fa3535d7477957a841"
#endif
#include "lconfig.h"
#endif

13
lib/include/lconfig.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef LAIKA_CONFIG_H
#define LAIKA_CONFIG_H
/* version info */
#define LAIKA_VERSION_MAJOR 0
#define LAIKA_VERSION_MINOR 0
/* keys */
#define LAIKA_PUBKEY "997d026d1c65deb6c30468525132be4ea44116d6f194c142347b67ee73d18814"
#define LAIKA_PRIVKEY "1dbd33962f1e170d1e745c6d3e19175049b5616822fac2fa3535d7477957a841"
#endif

13
lib/include/lconfig.h.in Normal file
View File

@@ -0,0 +1,13 @@
#ifndef LAIKA_CONFIG_H
#define LAIKA_CONFIG_H
/* version info */
#define LAIKA_VERSION_MAJOR @LAIKA_VERSION_MAJOR@
#define LAIKA_VERSION_MINOR @LAIKA_VERSION_MINOR@
/* keys */
#define LAIKA_PUBKEY "@LAIKA_PUBKEY@"
#define LAIKA_PRIVKEY "@LAIKA_PRIVKEY@"
#endif