Thursday 15 August 2013

dependencies - Some C++ source files are compiled for multiple dll -


In our projects my team wants to use some C ++ source files for different DLSs (for example MySource Cpp, among others, both are compiled twice for the production of ALL and BDLL). I would say this situation as "duplicate compilation" I think this is a very bad behavior and I find the main reason 2 reasons:

  • MySource.cpp should be able to support multiple compilers.
  • All dependencies of MySource.cpp should be compiled in ADL and BDL.

It bans many sources which will be compiled several times. Is there no other reason why it should not be done or why it is okay to do this?

In this way we came into this situation: We first created a module X, and then the other modules Y, Z, etc. ... which are dependent on X. But instead of exporting the functions of X to be used in Y, we have repeated the code of X so that a copy of all the code in the Y and Z module code is x. Then the code of X has evolved, and now we know that we need to merge all those code to have a real dependency. And now we are debating between the above "duct tape" solution and the making of an API for X.

My a.dll and B.dll a_b_common.dll in between.

The DLL functions can call the function in another DLL.


1 comment: