Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-03-04 03:30:12


David Abrahams wrote:
> I'm running into the following two problems, as you can see from the
> enclosed.
>
> The first problem is that I get warnings about unused response-file
> targets every time I link.

Not quite. The warning in the output you've posted is about unused SHARED_LIB
target. You've exe which has lib in sources. When lib is generated, both
SHARED_LIB and IMPORT_LIB targets are created. The latter is consumed by
the generator. The former is not, and a warning is issued. In this case, it's
not good. But assume you've just got one of sources ignored without a
warning. This use case was the motivation for the warning: putting LIB in
sources for another LIB was ignored without a warning.

What is the best solution? Introduce a mechanism to say: "I don't care if this
target is ignored"? Or request that at least one target from each source
reference is consumed. E.g in

exe e : e.cpp d ;

if "d" generates two targets, but one of them is consumed, then no warning is
issues. If none is consumed, you see the warning.

> The second is that somehow this flags rule invocation:
>
> flags msvc.link .LD $(condition) : $(prefix)$(linker) ;
>
> seems to be failing to take effect. It ought to be prepending the
> setup string:
>
> setup = "call \""$(path)\\bin\\$(setup)"\" > nul
> " ;
>
> to the link command, as it does for the compile command.

I cannot reproduce. My local diffs in dependency_test are

--- project-root.jam 1 Oct 2002 16:31:31 -0000 1.1
+++ project-root.jam 4 Mar 2003 08:24:39 -0000
@@ -1,3 +1,6 @@

import gcc ;
import foo ;
+
+import toolset : using ;
+using msvc : 6.5 : /foo/bar ;

When I run

bjam -n msvc-6.5, I get the attached output, which seems to include correct
preabmble for both compiler and linker. If I say

"using msvc : 6.5 ;"

I get just "cl"/"link". If you could send a reproducible example or a recipe
using CVS, I can look more. While I don't have msvc, "bjam -n" may be enough.

- Volodya
 --------------Boundary-00=_CAU7YVZ8NPHF8ZCXUAXH Content-Type: text/plain;
charset="iso-8859-1";
name="log"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="log"

W:\MyDocuments\boost-build\test\..\new\targets.jam:612: in check-for-unused-sources from module object(typed-target)@5
warning: Unused source target { msvc.link-d.SHARED_LIB { builtin.response-file-d.RSP { msvc.compile-y.OBJ { foo.foo-y.CPP { y.FOO } } } } }
Main target is ./e
W:\MyDocuments\boost-build\test\..\new\targets.jam:574: in object(typed-target)@5.generate from module object(typed-target)@5
W:\MyDocuments\boost-build\test\..\new\targets.jam:347: in generate-really from module object(main-target)@5
W:\MyDocuments\boost-build\test\..\new\targets.jam:325: in object(main-target)@5.generate from module object(main-target)@5
W:\MyDocuments\boost-build\test\..\new\targets.jam:182: in object(project-target)@1.generate from module object(project-target)@1
W:\MyDocuments\boost-build\test\..\new\build-system.jam:131: in load from module build-system
W:\MyDocuments\boost-build\test\..\new\modules.jam:171: in import from module modules
W:\MyDocuments\boost-build\test\..\new\bootstrap.jam:41: in boost-build from module
W:\MyDocuments\boost-build\test\boost-build.jam:2: in module scope from module
...found 42 targets...
...updating 25 targets...
MkDir1 bin

mkdir bin

MkDir1 bin\msvc-6.5

mkdir bin\msvc-6.5

MkDir1 bin\msvc-6.5\debug

mkdir bin\msvc-6.5\debug

foo.foo bin\msvc-6.5\debug\x.cpp bin\msvc-6.5\debug\x.h

echo void __declspec(dllexport) foo(){} > bin\msvc-6.5\debug\x.cpp
echo // > bin\msvc-6.5\debug\x.h

msvc.compile bin\msvc-6.5\debug\x.obj

call "/foo/bar\bin\vcvars32.bat" > nul
cl /Zm800 -nologo /Z7 /Od /Ob0 /GX /GR /MD -I"src1" -I"bin\msvc-6.5\debug" -c -Fo"bin\msvc-6.5\debug\x.obj" "bin\msvc-6.5\debug\x.cpp"

msvc.compile bin\msvc-6.5\debug\a.obj

call "/foo/bar\bin\vcvars32.bat" > nul
cl /Zm800 -nologo /Z7 /Od /Ob0 /GX /GR /MD -I"src1" -I"bin\msvc-6.5\debug" -c -Fo"bin\msvc-6.5\debug\a.obj" "a.cpp"

response-file-1 bin\msvc-6.5\debug\a.rsp

echo "bin\msvc-6.5\debug\x.obj" > "bin\msvc-6.5\debug\a.rsp"

response-file-2 bin\msvc-6.5\debug\a.rsp

echo "bin\msvc-6.5\debug\a.obj" >> "bin\msvc-6.5\debug\a.rsp"

msvc.link bin\msvc-6.5\debug\a.exe

call "/foo/bar\bin\vcvars32.bat" > nul
link /DEBUG /OPT:REF,ICF /subsystem:console /out:"bin\msvc-6.5\debug\a.exe" @"bin\msvc-6.5\debug\a.rsp"

msvc.compile bin\msvc-6.5\debug\b.obj

call "/foo/bar\bin\vcvars32.bat" > nul
cl /Zm800 -nologo /Z7 /Od /Ob0 /GX /GR /MD -I"src1" -I"bin\msvc-6.5\debug" -c -Fo"bin\msvc-6.5\debug\b.obj" "b.cpp"

response-file-1 bin\msvc-6.5\debug\b.rsp

echo "bin\msvc-6.5\debug\b.obj" > "bin\msvc-6.5\debug\b.rsp"

msvc.link bin\msvc-6.5\debug\b.exe

call "/foo/bar\bin\vcvars32.bat" > nul
link /DEBUG /OPT:REF,ICF /subsystem:console /out:"bin\msvc-6.5\debug\b.exe" @"bin\msvc-6.5\debug\b.rsp"

MkDir1 bin\msvc-6.5\debug\main-target-c

mkdir bin\msvc-6.5\debug\main-target-c

msvc.compile bin\msvc-6.5\debug\main-target-c\c.obj

call "/foo/bar\bin\vcvars32.bat" > nul
cl /Zm800 -nologo -DFOO /Z7 /Od /Ob0 /GX /GR /MD -I"src1" -I"bin\msvc-6.5\debug\main-target-c" -I"bin\msvc-6.5\debug" -c -Fo"bin\msvc-6.5\debug\main-target-c\c.obj" "c.cpp"

response-file-1 bin\msvc-6.5\debug\main-target-c\c.rsp

echo "bin\msvc-6.5\debug\main-target-c\c.obj" > "bin\msvc-6.5\debug\main-target-c\c.rsp"

msvc.link bin\msvc-6.5\debug\main-target-c\c.exe

call "/foo/bar\bin\vcvars32.bat" > nul
link /DEBUG /OPT:REF,ICF /subsystem:console /out:"bin\msvc-6.5\debug\main-target-c\c.exe" @"bin\msvc-6.5\debug\main-target-c\c.rsp"

foo.foo bin\msvc-6.5\debug\y.cpp bin\msvc-6.5\debug\y.h

echo void __declspec(dllexport) foo(){} > bin\msvc-6.5\debug\y.cpp
echo // > bin\msvc-6.5\debug\y.h

msvc.compile bin\msvc-6.5\debug\y.obj

call "/foo/bar\bin\vcvars32.bat" > nul
cl /Zm800 -nologo /Z7 /Od /Ob0 /GX /GR /MD -I"src1" -I"bin\msvc-6.5\debug" -c -Fo"bin\msvc-6.5\debug\y.obj" "bin\msvc-6.5\debug\y.cpp"

response-file-1 bin\msvc-6.5\debug\d.rsp

echo "bin\msvc-6.5\debug\y.obj" > "bin\msvc-6.5\debug\d.rsp"

msvc.link bin\msvc-6.5\debug\d.dll bin\msvc-6.5\debug\d.lib

call "/foo/bar\bin\vcvars32.bat" > nul
link /DEBUG /OPT:REF,ICF /subsystem:console /DLL /out:"bin\msvc-6.5\debug\d.dll" /INCREMENTAL:NO /IMPLIB:"bin\msvc-6.5\debug\d.lib" @"bin\msvc-6.5\debug\d.rsp"

MkDir1 bin\msvc-6.5\debug\main-target-e

mkdir bin\msvc-6.5\debug\main-target-e

msvc.compile bin\msvc-6.5\debug\main-target-e\e.obj

call "/foo/bar\bin\vcvars32.bat" > nul
cl /Zm800 -nologo -DFOO /Z7 /Od /Ob0 /GX /GR /MD -I"src1" -I"bin\msvc-6.5\debug\main-target-e" -I"bin\msvc-6.5\debug" -c -Fo"bin\msvc-6.5\debug\main-target-e\e.obj" "e.cpp"

response-file-1 bin\msvc-6.5\debug\main-target-e\e.rsp

echo "bin\msvc-6.5\debug\main-target-e\e.obj" > "bin\msvc-6.5\debug\main-target-e\e.rsp"

response-file-2 bin\msvc-6.5\debug\main-target-e\e.rsp

echo "bin\msvc-6.5\debug\d.lib" >> "bin\msvc-6.5\debug\main-target-e\e.rsp"

msvc.link bin\msvc-6.5\debug\main-target-e\e.exe

call "/foo/bar\bin\vcvars32.bat" > nul
link /DEBUG /OPT:REF,ICF /subsystem:console /out:"bin\msvc-6.5\debug\main-target-e\e.exe" @"bin\msvc-6.5\debug\main-target-e\e.rsp"

...updated 25 targets...
 --------------Boundary-00=_CAU7YVZ8NPHF8ZCXUAXH--


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