Vladimir,

We can remove the per-target behaviour entirely, and simply name the PDB after the end target (lib, shared lib, or exe). In fact, if it makes implementation easier, we can limit the use of the /Fd option to static libs, and use default behaviour for dlls (shared libs) / exes.

The main goal of my original submission was to have a PDB named after the end target in the case of static libraries. i.e., mylib.lib with mylib.pdb. This is important when static libs are distributed and / or checked into source control.

In the case of dlls / exes, the change is arguably overkill, as the linker will generate an exe-name.pdb (or dll-name.pdb) file automatically, regardless of the intermediate PDB name (at least, when not using precompiled headers). It seems a bit tidier to generate PDB files during compilation that are named after your end target. But I thought of one potential snafu with precompiled headers even in this case/

The problem is when two executables in the same project share a single source file. If source1.cpp is included by both exe1.exe and exe2.exe, and if source1.cpp's PDB info is written to exe1.pdb, then presumably precompiled headers will run into the same error that Michel encountered, unless something triggers recompilation of source1.cpp for exe2.exe. I don't see that as a serious limitation -- if you are sharing a source file, you can place it into a lib. But we can avoid it altogether by using default-named PDB files for sources when generating exes or pdbs.

regards,
Michael


On Sat, Aug 29, 2009 at 9:57 AM, Vladimir Prus <ghost@cs.msu.su> wrote:
On Saturday 29 August 2009 Steven Watanabe wrote:

> AMDG
>
> Vladimir Prus wrote:
> > On Wednesday 05 August 2009 Michel Krämer wrote:
> >
> >> Thanks for your answer. Unfortunately, that's not the case.
> >>
> >> I created a simple HelloWorld project, so you can test it yourself:
> >> http://www.nabble.com/file/p24822377/helloworld.zip helloworld.zip
> >>
> >
> > Do any MSVC experts have any insight into this issue? For convenience,
> > here's the original email explaining the issue:
> >
> >     http://article.gmane.org/gmane.comp.lib.boost.build/21227
> >
>
> The problem is that msvc requires the same pdb to be specified for
> the precompiled header as for the executable.  Currently the precompiled
> header generates the pdb in the default location, while the executable
> generates it depending on the executable's name.

Oh, bummer. So, there's no way to have one PCH used by more than one
executable/library, while still naming the pdb file as library.dll.pdb?
Shall this per-target pdb name behaviour be controlled by some option,
then?

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build