Esempio n. 1
0
DirectCommands::DirectCommands(CompilerGCC* compilerPlugin,
                                Compiler* compiler,
                                cbProject* project,
                                int logPageIndex)
    : m_doYield(false),
    m_PageIndex(logPageIndex),
    m_pCompilerPlugin(compilerPlugin),
//    m_pGenerator(generator),
    m_pCompiler(compiler),
    m_pProject(project),
    m_pCurrTarget(0)
{
    //ctor
    if (!m_pProject)
        return; // probably a compile file cmd without a project

    m_pCurrTarget = m_pProject->GetBuildTarget(m_pProject->GetActiveBuildTarget());
    depsStart();
    wxFileName cwd;
    cwd.Assign(m_pProject->GetBasePath());
    depsSetCWD(cwd.GetPath(wxPATH_GET_VOLUME).mb_str());

    wxFileName fname(m_pProject->GetFilename());
    fname.SetExt(_T("depend"));
    depsCacheRead(fname.GetFullPath().mb_str());
}
DirectCommands::DirectCommands(CompilerGCC* compilerPlugin,
                               Compiler*    compiler,
                               cbProject*   project,
                               int          logPageIndex) :
    m_doYield(false),
    m_PageIndex(logPageIndex),
    m_pCompilerPlugin(compilerPlugin),
    m_pCompiler(compiler),
    m_pProject(project),
    m_pGenerator(0)
{
    // even if there is no project, the command generator need to be
    // initialised for single file compilation to work.
    // it can handle a NULL pointer argument... ;-)
    m_pGenerator = m_pCompiler->GetCommandGenerator(m_pProject);

    // ctor
    if (!m_pProject)
        return; // probably a compile file cmd without a project

    depsStart();
    wxFileName cwd;
    cwd.Assign(m_pProject->GetBasePath());
    // depslib does special handling on Windows in case the CWD is a root
    // folder like "R:". But this ONLY works, if its just "R:", NOT e.g. "R:/"
    wxString depsCWD = cwd.GetPath(wxPATH_GET_VOLUME);
    Manager::Get()->GetLogManager()->DebugLog(F(_("CWD for depslib was: %s."), depsCWD.wx_str()));
    if (     (depsCWD.Len()==3)         && (depsCWD.GetChar(1)==':')
        && ( (depsCWD.GetChar(2)=='\\') || (depsCWD.GetChar(2)=='/') ) )
    {
        depsCWD.RemoveLast();
    }
    Manager::Get()->GetLogManager()->DebugLog(F(_("CWD for depslib is: %s."), depsCWD.wx_str()));
    depsSetCWD(depsCWD.mb_str());

    wxFileName fname(m_pProject->GetFilename());
    fname.SetExt(_T("depend"));
    depsCacheRead(fname.GetFullPath().mb_str());
}