|
Boost-Build : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-10-23 03:17:26
I have been experimenting with an alternative solution to getting
response files working. The problem with the existing solution is when a
target action fails. In that case we keep the response file around so
that the command line can be reproduced, but this prevents define or
include changes being picked up on these targets.
The solution is to output the response file contents on failure. What I
would like to do is set up an action/rule on the response file that is
called *after* the main target has completed and do something like:
actions post-process quietly response-file-cleanup
{
if target-failed
{
echo ">>> response file "$(rsp)
cat $(rsp)
echo "<<< end of response file"
}
rm $(rsp)
}
however, this is not currently possible, so I need to do something
similar to testing.jam on each target that uses response files:
actions compile.c++ bind RSP
{
$(.CC) ...
$(SET_STATUS)
if $(STATUS_NOT_0)
echo ">>> response file"
$(CATENATE) $(RSP)
echo "<<< response file"
$(ENDIF)
$(RM) $(RSP)
exit $(STATUS)
}
This fixes the problem, but contains a lot of repeated code and thus
complicates maintainability. Hence why I want to do that code in a
post-process response file actions.
I get the following output:
msvc.compile.c++ ..\..\..\build\tools\hex\msvc-7.1\release\main.obj
main.cpp
..\..\tools\hex\main.cpp(11) : error C2653: 'std' : is not a class or
namespace name
>>> response file
"..\..\tools\hex\main.cpp"
-DBOOST_ALL_NO_LIB
...
<<< response file
cl ... @"..\..\..\build\tools\hex\msvc-7.1\release\main.obj.rsp"
set status=%ERRORLEVEL%
if %status% NEQ 0 (
type ..\..\..\build\tools\hex\msvc-7.1\release\main.obj.rsp
)
del /f ..\..\..\build\tools\hex\msvc-7.1\release\main.obj.rsp
exit %status%
...failed msvc.compile.c++
..\..\..\build\tools\hex\msvc-7.1\release\main.obj...
...skipped <p..\..\..\build\tools\hex\msvc-7.1\release>hex.exe.rsp for
lack of <p..\..\..\build\tools\hex\msvc-7.1\release>main.obj...
Thoughts? Comments?
- Reece
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk