aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-07-26 14:54:21 -0400
committerDeterminant <[email protected]>2018-07-26 14:54:21 -0400
commit5f00c067f863f812a740dc209b1fb829f04042eb (patch)
tree1a4452299d729d9cd5c75871c2fdc32f2ee45564
parenta3f76ac9bb539ba55431cc74f5de09653185cdef (diff)
add auto generated config.h
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt6
-rw-r--r--include/hotstuff/util.h5
m---------salticidae0
-rw-r--r--src/config.h.in7
5 files changed, 12 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index f502a81..85d0a04 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@ hotstuff-keygen
libhotstuff.a
src/*.swo
src/*.swp
+include/hotstuff/config.h
*.a
*.o
*.la
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca4d39d..0e65e00 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,11 +58,7 @@ endif()
option(HOTSTUFF_ENABLE_DEBUG_LOG "enable debug log" OFF)
option(HOTSTUFF_ENABLE_NORMAL_LOG "enable normal log" ON)
-if(HOTSTUFF_ENABLE_DEBUG_LOG)
- add_definitions(-DHOTSTUFF_DEBUG_LOG)
-elseif(HOTSTUFF_ENABLE_NORMAL_LOG)
- add_definitions(-DHOTSTUFF_NORMAL_LOG)
-endif()
+configure_file(src/config.h.in include/hotstuff/config.h @ONLY)
# add executables
diff --git a/include/hotstuff/util.h b/include/hotstuff/util.h
index 42c0135..2b02cfd 100644
--- a/include/hotstuff/util.h
+++ b/include/hotstuff/util.h
@@ -1,6 +1,7 @@
#ifndef _HOTSTUFF_UTIL_H
#define _HOTSTUFF_UTIL_H
+#include "hotstuff/config.h"
#include "salticidae/util.h"
namespace hotstuff {
@@ -12,12 +13,12 @@ class Logger: public salticidae::Logger {
extern Logger logger;
-#ifdef HOTSTUFF_DEBUG_LOG
+#ifdef HOTSTUFF_ENABLE_DEBUG_LOG
#define HOTSTUFF_NORMAL_LOG
#define HOTSTUFF_ENABLE_LOG_DEBUG
#endif
-#ifdef HOTSTUFF_NORMAL_LOG
+#ifdef HOTSTUFF_ENABLE_NORMAL_LOG
#define HOTSTUFF_ENABLE_LOG_INFO
#define HOTSTUFF_ENABLE_LOG_WARN
#endif
diff --git a/salticidae b/salticidae
-Subproject 1b006d5164c605ef44652b4442309983bfc0d24
+Subproject 473551d760bb52d3c8d12b2096c10210e938738
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 0000000..ce1e575
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1,7 @@
+#ifndef _HOTSTUFF_CONFIG_H
+#define _HOTSTUFF_CONFIG_H
+
+#cmakedefine HOTSTUFF_ENABLE_DEBUG_LOG
+#cmakedefine HOTSTUFF_ENABLE_NORMAL_LOG
+
+#endif