Skip to content

Commit 962bc44

Browse files
committed
Support setting output project directory
1 parent 0cbe146 commit 962bc44

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ This example shows how to generate a complete gRPC project from the `example.pro
5555
--template ./template \
5656
--out_server_file example/include/grpc_server.hpp \
5757
--out_client_file example/include/grpc_client.hpp \
58+
--example ./example_project \
5859
--format=clang-format
5960

6061
2. **Build and run the generated project:**

cpp-grpc-auto-gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def copy_proto_files(proto_files, dest_dir):
5454
parser.add_argument('--format', type=str, default='clang-format', help='Code formatter command (e.g., clang-format). Use "none" to disable.')
5555
parser.add_argument('--out_server_file', type=str, required=True, help='Output path for the main generated header file')
5656
parser.add_argument('--out_client_file', type=str, required=True, help='Output path for the main generated header file')
57+
parser.add_argument('--example', type=str, default='./example_project', help='Output path for the example project')
5758
args = parser.parse_args()
5859

5960
# --- Setup ---
@@ -76,7 +77,7 @@ def copy_proto_files(proto_files, dest_dir):
7677

7778
# --- Example Project Generation ---
7879
print("\n--- Generating Project ---")
79-
example_dir = "example_project"
80+
example_dir = args.example
8081
src_dir = os.path.join(example_dir, "src")
8182
include_dir = os.path.join(example_dir, "include")
8283
proto_dir = os.path.join(example_dir, "proto")

0 commit comments

Comments
 (0)