2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Use suitable names for PDB files for static libs.

Patch from Michael Weber.


[SVN r55155]
This commit is contained in:
Vladimir Prus
2009-07-25 09:23:24 +00:00
parent c0331da85b
commit ccfc9b40d1

View File

@@ -347,15 +347,27 @@ toolset.flags msvc YLOPTION : "-Yl" ;
# Action for running the C/C++ compiler without using precompiled headers.
#
# WARNING: Synchronize any changes this in action with intel-win
actions compile-c-c++
#
# Notes regarding PDB generation, for when we use <debug-symbols>on/<debug-store>database
#
# 1. PDB_CFLAG is only set for <debug-symbols>on/<debug-store>database, ensuring that the /Fd flag is dropped if PDB_CFLAG is empty
#
# 2. When compiling executables's source files, PDB_NAME is set on a per-source file basis by rule compile-c-c++.
# The linker will pull these into the executable's PDB
#
# 3. When compiling library's source files, PDB_NAME is updated to <libname>.pdb for each source file by rule archive,
# as in this case the compiler must be used to create a single PDB for our library.
#
actions compile-c-c++ bind PDB_NAME
{
$(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
$(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
}
rule compile-c-c++ ( targets + : sources * )
{
DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ;
DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ;
PDB_NAME on $(<) = $(<:S=.pdb) ;
}
# Action for running the C/C++ compiler using precompiled headers. In addition
@@ -507,6 +519,16 @@ else
}
}
# this rule sets up the pdb file that will be used when generating static
# libraries and the debug-store option is database, so that the compiler
# puts all debug info into a single .pdb file named after the library
#
# Poking at source targets this way is probably not clean, but it's the
# easiest approach.
rule archive ( targets + : sources * : properties * )
{
PDB_NAME on $(>) = $(<:S=.pdb) ;
}
################################################################################
#
@@ -1146,7 +1168,7 @@ local rule register-toolset-really ( )
toolset.flags msvc.compile.c OPTIONS <cflags> : ;
toolset.flags msvc.compile.c++ OPTIONS <cxxflags> : ;
toolset.flags msvc.compile PDB_CFLAG <debug-symbols>on/<debug-store>database : /Fd ; # not used yet
toolset.flags msvc.compile PDB_CFLAG <debug-symbols>on/<debug-store>database : /Fd ;
toolset.flags msvc.compile DEFINES <define> ;
toolset.flags msvc.compile UNDEFS <undef> ;