-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added fixed size string * added fixed size bytes * better doc
- Loading branch information
1 parent
11a9a93
commit db6d97f
Showing
19 changed files
with
1,198 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
spb_protobuf_generate(PROTO_SRCS PROTO_HDRS proto/addressbook.proto) | ||
spb_protobuf_generate(PROTO_ETL_SRCS PROTO_ETL_HDRS proto/etl.proto) | ||
|
||
add_executable(addressbook addressbook.cpp ${PROTO_SRCS}) | ||
target_link_libraries(addressbook PUBLIC spb-proto) | ||
|
||
Include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
etl | ||
GIT_REPOSITORY https://github.com/ETLCPP/etl | ||
GIT_TAG "20.39.4" | ||
) | ||
|
||
FetchContent_MakeAvailable(etl) | ||
|
||
add_executable(etl-example etl.cpp ${PROTO_ETL_SRCS}) | ||
target_link_libraries(etl-example PUBLIC spb-proto etl::etl) | ||
|
||
include(CheckIPOSupported) | ||
check_ipo_supported(RESULT result) | ||
if(result) | ||
set_target_properties(addressbook PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
set_target_properties(etl PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "spb/pb.hpp" | ||
#include <etl.pb.h> | ||
#include <iostream> | ||
|
||
auto create_command( uint8_t arg ) -> ETL::Example::Command | ||
{ | ||
return { | ||
.command_id = uint8_t( ETL::Example::Command::CMD::CMD_READ ), | ||
.arg = arg, | ||
.in_flag = 1, | ||
.out_flag = 0, | ||
}; | ||
} | ||
|
||
auto main( int argc, char * argv[] ) -> int | ||
{ | ||
std::cout << "sizeof(Command): " << sizeof( ETL::Example::Command ) << std::endl; | ||
std::cout << "sizeof(DeviceStatus): " << sizeof( ETL::Example::DeviceStatus ) << std::endl; | ||
std::cout << "sizeof(CommandQueue): " << sizeof( ETL::Example::CommandQueue ) << std::endl; | ||
|
||
return 0; | ||
} |
Oops, something went wrong.