mirror of
https://github.com/GayPizzaSpecifications/stable-diffusion-rpc.git
synced 2025-08-04 14:01:32 +00:00
Start work on C++ client, and implement streaming of image generation.
This commit is contained in:
22
Clients/Cpp/CMakeLists.txt
Normal file
22
Clients/Cpp/CMakeLists.txt
Normal file
@ -0,0 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(sdrpc)
|
||||
|
||||
find_package(Protobuf CONFIG REQUIRED)
|
||||
find_package(gRPC CONFIG REQUIRED)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
add_library(sdrpc src/StableDiffusion.proto)
|
||||
|
||||
get_target_property(grpc_cpp_plugin_location gRPC::grpc_cpp_plugin LOCATION)
|
||||
|
||||
protobuf_generate(TARGET sdrpc LANGUAGE cpp)
|
||||
protobuf_generate(TARGET sdrpc LANGUAGE grpc
|
||||
GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc
|
||||
PLUGIN "protoc-gen-grpc=${grpc_cpp_plugin_location}")
|
||||
target_include_directories(sdrpc PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
target_link_libraries(sdrpc PUBLIC protobuf::libprotobuf gRPC::grpc gRPC::grpc++)
|
||||
|
||||
add_executable(sdrpc_sample src/sample.cpp)
|
||||
target_include_directories(sdrpc_sample PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
target_link_libraries(sdrpc_sample PRIVATE sdrpc)
|
Reference in New Issue
Block a user