Some tools like purify must be executed against the compile or link step when building an executable. This isn't currently supported in cc-tasks, as there isn't a way to directly access the command line. It would be useful if cc-tasks provided a way to prepend arbitrary commands before the compile or link commands when executing requests.
The following is a rough proposal for a syntax for supporting decorators (in this case, demonstrating a link decorator, however it would look the same for a compile decorator:
<project name="test" default="test1" xmlns:cpp="antlib:net.sf.antcontrib.cpptasks">
<cpp:linker name="msvc" id="link1">
<arg value="/1" />
<cpp:linker extends="link1" id="link2">
<arg value="/2" />
<mkdir dir="obj" />
<cpp:cc objdir="obj" outfile="foo.exe" outtype="executable" subsystem="console">
<decorator command="C.bat" />
<decorator command="D.bat" />
<fileset dir="src" id="id">
<include name="*.cpp" />
When linking, this would produce a command-line like the following:
D.bat C.bat B.bat /2 A.bat /1 link /NOLOGO /SUBSYSTEM:CONSOLE /INCREMENTAL:NO /OUT:foo.exe.exe obj\main.obj
A prototype implementation for the API above is defined in the attached diff.
Log in to post a comment.