Implement --file-names-only (#8788)

* flatc builds and seems to work, some of the extra targets are having linker errors

* fix build system

* pipeline failures

* un-rename files

* refactor to use unique_ptr

* typo

* rm make_unique, add comments

* fix cmake

---------

Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
This commit is contained in:
Justin Davis
2025-12-02 23:37:06 -05:00
committed by GitHub
parent 0b60686e3d
commit a1e125af11
34 changed files with 207 additions and 210 deletions

View File

@@ -716,7 +716,6 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc,
if (++argi >= argc) Error("missing path following: " + arg, true);
options.annotate_schema = flatbuffers::PosixPath(argv[argi]);
} else if (arg == "--file-names-only") {
// TODO (khhn): Provide 2 implementation
options.file_names_only = true;
} else if (arg == "--grpc-filename-suffix") {
if (++argi >= argc) Error("missing gRPC filename suffix: " + arg, true);
@@ -963,6 +962,7 @@ std::unique_ptr<Parser> FlatCompiler::GenerateCode(const FlatCOptions& options,
if (code_generator->SupportsBfbsGeneration()) {
CodeGenOptions code_gen_options;
code_gen_options.output_path = options.output_path;
code_gen_options.file_saver = options.opts.file_saver;
const CodeGenerator::Status status = code_generator->GenerateCode(
bfbs_buffer, bfbs_length, code_gen_options);