Skip to content

Commit

Permalink
Split no grpc on types.
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd committed Nov 9, 2023
1 parent 0efcd4b commit dfffc16
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/flatb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
cmake_minimum_required(VERSION 3.11)

list(APPEND SCHEMA_FLAGS "--gen-object-api" "--scoped-enums" "--gen-name-strings" "--cpp-std=c++17" "--cpp-static-reflection")

flatbuffers_generate_headers(
TARGET fbschemas
SCHEMAS "raft_types.fbs" "messaging_service.fbs"
FLAGS "--grpc" "--gen-object-api" "--scoped-enums" "--gen-name-strings" "--cpp-std=c++17" "--cpp-static-reflection"
SCHEMAS "raft_types.fbs"
FLAGS ${SCHEMA_FLAGS}
)
flatbuffers_generate_headers(
TARGET fbservice
SCHEMAS "messaging_service.fbs"
FLAGS "--grpc" ${SCHEMA_FLAGS}
)

add_library(${PROJECT_NAME}-fb OBJECT)
target_sources(${PROJECT_NAME}-fb PRIVATE $<TARGET_PROPERTY:fbschemas,INTERFACE_SOURCES>)
target_sources(${PROJECT_NAME}-fb PRIVATE
$<TARGET_PROPERTY:fbservice,INTERFACE_SOURCES>
)
target_include_directories(${PROJECT_NAME}-fb PUBLIC
$<TARGET_PROPERTY:fbschemas,INTERFACE_INCLUDE_DIRECTORIES>
)
target_link_libraries(${PROJECT_NAME}-fb
flatbuffers::flatbuffers
gRPC::grpc++
)
add_dependencies(${PROJECT_NAME}-fb GENERATE_fbschemas)
add_dependencies(${PROJECT_NAME}-fb GENERATE_fbservice)

0 comments on commit dfffc16

Please sign in to comment.