Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
blozano-tt opened this issue Apr 30, 2025 · 1 comment
Open

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

blozano-tt opened this issue Apr 30, 2025 · 1 comment

Comments

@blozano-tt
Copy link

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?

@aardappel
Copy link
Collaborator

No, I don't think this would make sense.

This is very little code, and normally building support for these languages would take less than a second on most machines. I cannot imagine how it takes over a second to compile a single function like your log appears to indicate, what kind of machine is this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants