[Ns-developers] static ns-3 take two

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Mon Feb 16 11:24:10 PST 2009


On Mon, 2009-02-16 at 11:46 +0000, Gustavo Carneiro wrote:

>  fond of regexp-scanning the entire set of ns-3 .cc files for every
> build :-/

Yes, this is not beautiful or efficient but you could also use waf build
rules to generate a temporary .cc file for each source file:
src/mobility/mobility-model.cc ->
build/debug/src/mobility/typeids/mobility-model.cc and then, concatenate
all these files in build/debug/typeids.cc and, then, link the
corresponding object file in the final binaries. The code of each .cc
file could be something like this:
#include "ns3/object-base.h"
NS_OBJECT_ENSURE_REGISTERED_STATIC(XXX);
with this macro defined appropriately in object-base.h.

I am sure you will come up with something better than this :)

regards,
Mathieu



More information about the Ns-developers mailing list