Archived

This forum has been archived. Please start a new discussion on GitHub.

What's the difference between generatecs.exe and slice2cs.exe?

I've recently started working with Ice for C# and noticed that the demo Visual Studio projects call generatecs.exe as a pre-build event. Why? What does it do that's different from slice2cs.exe?

Also, I can't find docs for generatecs.exe anywhere. The usage statement helps a bit:
usage: generatecs.exe solution_dir project_dir slice_name [args]

But what are the optional args?

thanks,

chris

Comments

  • Unfortunately, unlike Visual C++, Visual C# does not have built-in support for conditional build events. All it can do is run a pre-build event unconditionally every time a project is compiled. The pre-build event is need to compile the Slice files, but we don't want to compile all the Slice files every time--we only want to compile them if they've been touched.

    So, generatecs.exe is a pre-build command that does that. (It's a poor man's make.) In essence, all it does is check whether, for a particular Slice file, the corresponding C# file exists and has a time stamp that is older than the time stamp of the Slice file. If not, it compiles the Slice file. The additional args are just arguments that are passed through to slice2cs.

    You can find the source code for generatecs.exe in the generate subdirectory of the C# distribution.

    Cheers,

    Michi.