Search code examples
c++macosserializationcmakeflatbuffers

What is the difference in interfaces generated by different flatc compilers (Win64/ Win 32/ Mac)?


For different architecture and environment (like Win64/ Win 32/ Mac) cmake generates different projects, which further compiles to give different flatc compilers. My doubt is:

  1. Do these flatc compilers generate same interfaces (Cpp headers) from a given schema, or there is some difference in them?
  2. Why is there so much difference in size of these flatc executable, in case they perform same functionality!
  3. Should I use different flatc to generate schema on different platforms? or can use the same generated interfaces on all three platforms?

Please help.

stats for release flatc binaries from flatbuffers-1.8.0:

  • win64 1238KB
  • win32 961KB
  • mac 1145KB

Github project: https://github.com/google/flatbuffers


Solution

    1. Yes.
    2. This has to do with the C++ compilers, and has nothing to do with FlatBuffers. You'll get size differences for any C++ program you compile with multiple compilers / architectures. Those size differences you quote are actually fairly small (Xcode defaults to 64 bits btw).
    3. It does not matter which flatc you use, output will be identical.