aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-07-25 12:20:07 -0400
committerDeterminant <[email protected]>2018-07-25 12:20:07 -0400
commit1b006d5164c605ef44652b4442309983bfc0d24a (patch)
tree096c6fe702888850d4bf08cf682579f73a2e9479
parentcd2fc3625d09f2f3f062648ff9963414e0140e2a (diff)
...
-rw-r--r--CMakeLists.txt6
-rw-r--r--README.rst5
-rw-r--r--test/test_msg.cpp2
-rw-r--r--test/test_network.cpp3
4 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc6ce86..c004fd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,9 +51,11 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release")
endif()
-if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+option(SALTICIDAE_ENABLE_DEBUG_LOG "enable debug log" OFF)
+option(SALTICIDAE_ENABLE_NORMAL_LOG "enable regular log" ON)
+if (SALTICIDAE_ENABLE_DEBUG_LOG)
add_definitions(-DSALTICIDAE_DEBUG_LOG)
-elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
+elseif(SALTICIDAE_ENABLE_NORMAL_LOG)
add_definitions(-DSALTICIDAE_NORMAL_LOG)
endif()
diff --git a/README.rst b/README.rst
index 4437b8c..827341d 100644
--- a/README.rst
+++ b/README.rst
@@ -84,7 +84,10 @@ Example (MsgNetwork layer)
MsgAck() {}
MsgAck(DataStream &&s) {}
};
-
+
+ const opcode_t MsgHello::opcode;
+ const opcode_t MsgAck::opcode;
+
using MsgNetworkByteOp = MsgNetwork<opcode_t>;
struct MyNet: public MsgNetworkByteOp {
diff --git a/test/test_msg.cpp b/test/test_msg.cpp
index e4f35fa..ee13166 100644
--- a/test/test_msg.cpp
+++ b/test/test_msg.cpp
@@ -61,6 +61,8 @@ struct MsgTest {
}
};
+const opcode_t MsgTest::opcode;
+
int main() {
salticidae::MsgBase<opcode_t> msg(MsgTest(10));
printf("%s\n", std::string(msg).c_str());
diff --git a/test/test_network.cpp b/test/test_network.cpp
index f84ead5..fd84c3b 100644
--- a/test/test_network.cpp
+++ b/test/test_network.cpp
@@ -71,6 +71,9 @@ struct MsgAck {
MsgAck(DataStream &&s) {}
};
+const opcode_t MsgHello::opcode;
+const opcode_t MsgAck::opcode;
+
using MsgNetworkByteOp = MsgNetwork<opcode_t>;
struct MyNet: public MsgNetworkByteOp {