[C++] Add option to not generate direct copy methods. (#6166)

* Add option to not generate direct copy methods.

The direct copy methods generated by flatc utilize std::vector which isn't allowed on some embedded systems. Permit users of the compiler to not generate these methods so they don't have to be stubbed out.

* Update docs for no-cpp-direct-copy option.
This commit is contained in:
astange
2020-10-12 15:25:10 -04:00
committed by GitHub
parent 04bec23a37
commit 4ec5e8db90
4 changed files with 8 additions and 1 deletions

View File

@@ -282,6 +282,8 @@ int FlatCompiler::Compile(int argc, const char **argv) {
opts.cpp_object_api_string_type = argv[argi];
} else if (arg == "--cpp-str-flex-ctor") {
opts.cpp_object_api_string_flexible_constructor = true;
} else if (arg == "--no-cpp-direct-copy") {
opts.cpp_direct_copy = false;
} else if (arg == "--gen-nullable") {
opts.gen_nullable = true;
} else if (arg == "--java-checkerframework") {