// DoPreLinkCleanup //------------------------------------------------------------------------------ void LinkerNode::DoPreLinkCleanup() const { // only for Microsoft compilers if ( GetFlag( LINK_FLAG_MSVC ) == false ) { return; } bool deleteFiles = false; if ( GetFlag( LINK_FLAG_INCREMENTAL ) ) { if ( FBuild::Get().GetOptions().m_ForceCleanBuild ) { deleteFiles = true; // force a full re-link } } else { // cleanup old ILK files and force PDB to be rebuilt // (old PDBs get large and dramatically slow link times) deleteFiles = true; } // Work around for VS2013/2015 bug where /showincludes doesn't work if cl.exe // thinks it can skip compilation (it outputs "Note: reusing persistent precompiled header %s") // If FASTBuild is building because we've not built before, then cleanup old files // to ensure VS2013/2015 /showincludes will work if ( GetStamp() == 0 ) { deleteFiles = true; } if ( deleteFiles ) { // output file FileIO::FileDelete( GetName().Get() ); // .ilk const char * lastDot = GetName().FindLast( '.' ); AStackString<> ilkName( GetName().Get(), lastDot ? lastDot : GetName().GetEnd() ); ilkName += ".ilk"; FileIO::FileDelete( ilkName.Get() ); // .pdb - TODO: Handle manually specified /PDB AStackString<> pdbName( GetName().Get(), lastDot ? lastDot : GetName().GetEnd() ); pdbName += ".pdb"; FileIO::FileDelete( pdbName.Get() ); } }
// DoPreLinkCleanup //------------------------------------------------------------------------------ void LinkerNode::DoPreLinkCleanup() const { // only for Microsoft compilers if ( GetFlag( LINK_FLAG_MSVC ) == false ) { return; } bool deleteFiles = false; if ( GetFlag( LINK_FLAG_INCREMENTAL ) ) { if ( FBuild::Get().GetOptions().m_ForceCleanBuild ) { deleteFiles = true; // force a full re-link } } else { // cleanup old ILK files and force PDB to be rebuilt // (old PDBs get large and dramatically slow link times) deleteFiles = true; } if ( deleteFiles ) { // output file FileIO::FileDelete( GetName().Get() ); // .ilk const char * lastDot = GetName().FindLast( '.' ); AStackString<> ilkName( GetName().Get(), lastDot ? lastDot : GetName().GetEnd() ); ilkName += ".ilk"; FileIO::FileDelete( ilkName.Get() ); // .pdb - TODO: Handle manually specified /PDB AStackString<> pdbName( GetName().Get(), lastDot ? lastDot : GetName().GetEnd() ); pdbName += ".pdb"; FileIO::FileDelete( pdbName.Get() ); } }