Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
ccba2edb
Commit
ccba2edb
authored
Dec 14, 2016
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made GRPC generator missing into a warning.
Change-Id: Iceb1f5b78cff6227905b8a23eb70e9ef6ce909ed
parent
2a7a44be
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
flatc.cpp
src/flatc.cpp
+11
-4
No files found.
src/flatc.cpp
View file @
ccba2edb
...
...
@@ -95,9 +95,14 @@ const Generator generators[] = {
const
char
*
g_program_name
=
nullptr
;
flatbuffers
::
Parser
*
g_parser
=
nullptr
;
static
void
Warn
(
const
std
::
string
&
warn
,
bool
show_exe_name
=
true
)
{
if
(
show_exe_name
)
printf
(
"%s: "
,
g_program_name
);
printf
(
"warning: %s
\n
"
,
warn
.
c_str
());
}
static
void
Error
(
const
std
::
string
&
err
,
bool
usage
,
bool
show_exe_name
)
{
if
(
show_exe_name
)
printf
(
"%s: "
,
g_program_name
);
printf
(
"%s
\n
"
,
err
.
c_str
());
printf
(
"
error:
%s
\n
"
,
err
.
c_str
());
if
(
usage
)
{
printf
(
"usage: %s [OPTION]... FILE... [-- FILE...]
\n
"
,
g_program_name
);
for
(
size_t
i
=
0
;
i
<
sizeof
(
generators
)
/
sizeof
(
generators
[
0
]);
++
i
)
...
...
@@ -139,6 +144,7 @@ static void Error(const std::string &err, bool usage, bool show_exe_name) {
" --raw-binary Allow binaries without file_indentifier to be read.
\n
"
" This may crash flatc given a mismatched schema.
\n
"
" --proto Input is a .proto, translate to .fbs.
\n
"
" --grpc Generate GRPC interfaces for the specified languages
\n
"
" --schema Serialize schemas instead of JSON (use with -b)
\n
"
" --conform FILE Specify a schema the following schemas should be
\n
"
" an evolution of. Gives errors if not.
\n
"
...
...
@@ -373,13 +379,14 @@ int main(int argc, const char *argv[]) {
}
if
(
grpc_enabled
)
{
if
(
generators
[
i
].
generateGRPC
!=
nullptr
)
{
if
(
!
generators
[
i
].
generateGRPC
(
*
g_parser
,
output_path
,
filebase
))
{
if
(
!
generators
[
i
].
generateGRPC
(
*
g_parser
,
output_path
,
filebase
))
{
Error
(
std
::
string
(
"Unable to generate GRPC interface for"
)
+
generators
[
i
].
lang_name
);
}
}
else
{
Error
(
std
::
string
(
"GRPC interface generator not implemented for "
)
+
generators
[
i
].
lang_name
);
Warn
(
std
::
string
(
"GRPC interface generator not implemented for "
)
+
generators
[
i
].
lang_name
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment