Hello,
So im not quite sure what term to use for this, but as the title says, i would like to create a custom build step.
In Visual Studio i can see that there are options for this, such as "Custom Build Step" and "Build Events" properties.
Im not sure if these are the right ones or how to really go about using them for what i would like to do.
So what i would like to accomplish is to be able to add new custom preprocessor functions, like __FILE__, __LINE__ etc.
Is there an existing solution for doing things like this?
Example of what i would like to do:
// what the developer see
struct Object {
const char * getName() const {
return __OBJECT_NAME__;
}
};
// what the compiler see
struct Object {
const char * getName() const {
return "Object";
}
};
Looking at the existing options that i know of so far, i could use the "Build Events" and from the pre step allow a custom
tool to go in and parse and generate code. This however seems like going the long way instead of the intended route.
And i would then have to restore the files to their original state after compilation was completed.
Also, this might be a stretch. But being able to do something like this would be awesome.
// what the developer see
template< class T >
struct Object {
const char * getTypeName() const {
return __TYPE_NAME__(T);
}
};
// what the compiler see
template< class T >
struct Object {
const char * getTypeName() const {
return "int"; // or whatever type T is
}
};
So that would mean that the tool / buildstep would have to be injected at the right time after templates have been resolved
and im just guessing that this is out of the question..
Looking at the "Custom Build Step" options im not quite sure how i would use that, it dident look like it would be a step in the
right direction for the problem im trying to solve, but maby im just missing something.
Suggestions and ideas are very welcome