1

Now Qt generates one .o file per every .cpp file in my project. Can I force it to generate only one huge .o file? Or can I convert multiple .o files in a single one using some utils?

Edit1: The reason why I am doing that is because I want to compile a signle exe (no dlls) but LGPL requires that statically linked programs must be provided with it's object files. Here (https://stackoverflow.com/a/17736670/1389883) written that I can provide only one huge object file.

Community
  • 1
  • 1
iamnp
  • 510
  • 8
  • 23

1 Answers1

1

Your question is not clear which toolchain you are working with, so I will assume you need a cross-platform solution as opposed to one specific.

I think you are looking for something that we have used in the KDE which was KDE4_ENABLE_FINAL. It will decrease the linkage time by having one object file as you wish to have, but on the other hand, it will use more memory for sure.

You can check how that cmake variable is handled underneath. It basically just concatenates the source files together to be a single compilation unit. It is done because there is no such a direct option to the underlying toolchains.

László Papp
  • 51,870
  • 39
  • 111
  • 135