Skip to content

[CMake] Can we build flatbuffers with only one language support? #8587

Open
@blozano-tt

Description

@blozano-tt

We use flatbuffers exclusively in a C++ context.

Yet, I see compile time being spent on languages I don't need:

  1311 ms: flatbuffers::csharp::CSharpGenerator::GenStruct(flatbuffers::StructD... (/work/.cpmcache/flatbuffers/2c4062bffa52fa4157b1b4deeae73395df475fda/src/idl_gen_csharp.cpp)
  1127 ms: flatbuffers::java::JavaGenerator::GenStruct(flatbuffers::StructDef&,... (/work/.cpmcache/flatbuffers/2c4062bffa52fa4157b1b4deeae73395df475fda/src/idl_gen_java.cpp)
   991 ms: flatbuffers::ts::TsGenerator::GenObjApi(flatbuffers::Parser const&, ... (/work/.cpmcache/flatbuffers/2c4062bffa52fa4157b1b4deeae73395df475fda/src/idl_gen_ts.cpp)
   950 ms: flatbuffers::ts::TsGenerator::GenStruct(flatbuffers::Parser const&, ... (/work/.cpmcache/flatbuffers/2c4062bffa52fa4157b1b4deeae73395df475fda/src/idl_gen_ts.cpp)
   814 ms: flatbuffers::java::JavaGenerator::GenPackUnPack_ObjectAPI(flatbuffer... (/work/.cpmcache/flatbuffers/2c4062bffa52fa4157b1b4deeae73395df475fda/src/idl_gen_java.cpp)
   651 ms: flatbuffers::csharp::CSharpGenerator::GenPackUnPack_ObjectAPI(flatbu... (/work/.cpmcache/flatbuffers/2c4062bffa52fa4157b1b4deeae73395df475fda/src/idl_gen_csharp.cpp)
   445 ms: flatbuffers::jsons::JsonSchemaGenerator::generate() (/work/.cpmcache/flatbuffers/2c4062bffa52fa4157b1b4deeae73395df475fda/src/idl_gen_json_schema.cpp)

Would it be possible to add CMake options to exclude certain languages, or include only subset of language support?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions