mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 23:22:19 +00:00
Adds no-includes flags to the swift code generator (#7182)
This commit is contained in:
@@ -367,7 +367,7 @@ flatc(
|
|||||||
# Swift Tests
|
# Swift Tests
|
||||||
swift_prefix = "FlatBuffers.Test.Swift/Tests/FlatBuffers.Test.SwiftTests"
|
swift_prefix = "FlatBuffers.Test.Swift/Tests/FlatBuffers.Test.SwiftTests"
|
||||||
flatc(
|
flatc(
|
||||||
SWIFT_OPTS + NO_INCL_OPTS + ["--grpc"],
|
SWIFT_OPTS + BASE_OPTS + ["--grpc"],
|
||||||
schema="monster_test.fbs",
|
schema="monster_test.fbs",
|
||||||
include="include_test",
|
include="include_test",
|
||||||
prefix=swift_prefix,
|
prefix=swift_prefix,
|
||||||
|
|||||||
@@ -167,9 +167,10 @@ class SwiftGenerator : public BaseGenerator {
|
|||||||
code_ += "// " + std::string(FlatBuffersGeneratedWarning());
|
code_ += "// " + std::string(FlatBuffersGeneratedWarning());
|
||||||
code_ += "// swiftlint:disable all";
|
code_ += "// swiftlint:disable all";
|
||||||
code_ += "// swiftformat:disable all\n";
|
code_ += "// swiftformat:disable all\n";
|
||||||
code_ += "import FlatBuffers\n";
|
if (parser_.opts.include_dependence_headers || parser_.opts.generate_all)
|
||||||
// Generate code for all the enum declarations.
|
code_ += "import FlatBuffers\n";
|
||||||
|
|
||||||
|
// Generate code for all the enum declarations.
|
||||||
for (auto it = parser_.enums_.vec.begin(); it != parser_.enums_.vec.end();
|
for (auto it = parser_.enums_.vec.begin(); it != parser_.enums_.vec.end();
|
||||||
++it) {
|
++it) {
|
||||||
const auto &enum_def = **it;
|
const auto &enum_def = **it;
|
||||||
|
|||||||
Reference in New Issue
Block a user