Skip to content

Commit

Permalink
cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
yksten committed Dec 5, 2020
1 parent f6b3c5f commit 8755c3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ ELSE ()
ENDIF (MSVC)


SET(TESTER "./tester/main.cpp" "./tester/testStruct.h")
SOURCE_GROUP(tester FILES ${TESTER})

ADD_EXECUTABLE(tester ${TESTER})
TARGET_LINK_LIBRARIES(tester serialize)
SET(EXEC OFF CACHE BOOL "")
if (${EXEC} STREQUAL ON)
SET(TESTER "./tester/main.cpp" "./tester/testStruct.h")
SOURCE_GROUP(tester FILES ${TESTER})
ADD_EXECUTABLE(tester ${TESTER})
TARGET_LINK_LIBRARIES(tester serialize)
endif()
2 changes: 1 addition & 1 deletion include/protobuf/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace proto {

//TYPE_VARINT = 0, // int32,int64,uint32,uint64,bool,enum
template<typename T, typename P> struct convertVarint {
static inline T value(const P& cValue) { return T(cValue); }
static inline T value(const P& cValue) { return static_cast<T>(cValue); }
};
template<> struct convertVarint<float, uint32_t> {
static inline float value(const uint32_t& cValue) { union { uint32_t i; float f; }; i = cValue; return f; }
Expand Down

0 comments on commit 8755c3f

Please sign in to comment.