Patch #3053 2010-08-28 00:00

bioinfornatics

D programming 2
Download
3053-D_programming.patch (13.1 KB)
Category
 
Status
Rejected
Close date
2010-08-28 21:42
Assigned to
 
/*
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
 * http://www.gnu.org/licenses/gpl-3.0.html
 */

#include <sdk.h>
#include <prep.h>
#include "compilerLDC.h"
#include <wx/intl.h>
#include <wx/regex.h>
#include <wx/config.h>
#include <wx/fileconf.h>
#include <wx/msgdlg.h>
#include "manager.h"
#include "logmanager.h"

#include <configmanager.h>

#ifdef __WXMSW__
    #include <wx/msw/registry.h>
#endif

CompilerLDC::CompilerLDC()
    : Compiler(_("LDC D Compiler"), _T("ldc"))
{
    Reset();
}

CompilerLDC::~CompilerLDC()
{
    //dtor
}

Compiler * CompilerLDC::CreateCopy()
{
    Compiler* c = new CompilerLDC(*this);
    c->SetExtraPaths(m_ExtraPaths); // wxArrayString doesn't seem to be copied with the default copy ctor...
    return c;
}

void CompilerLDC::Reset()
{
    if (platform::windows)
    {
        m_Programs.C = _T("mingw32-ldc.exe");
        m_Programs.CPP = _T("mingw32-ldc.exe");
        m_Programs.LD = _T("mingw32-ldc.exe");
        m_Programs.DBG = _T("gdb.exe");
        m_Programs.LIB = _T("ar.exe");
        m_Programs.WINDRES = _T("windres.exe");
        m_Programs.MAKE = _T("mingw32-make.exe");
    }
    else
    {
        m_Programs.C = _T("ldc");
        m_Programs.CPP = _T("ldc");
        m_Programs.LD = _T("ldc");
        m_Programs.DBG = _T("gdb");
        m_Programs.LIB = _T("ar");
        m_Programs.WINDRES = _T("");
        m_Programs.MAKE = _T("make");
    }
    m_Switches.includeDirs = _T("-I");
    m_Switches.libDirs = _T("-L");
    m_Switches.linkLibs = _T("-l");
    m_Switches.defines = _T("-d-version=");
    m_Switches.genericSwitch = _T("-");
    m_Switches.objectExtension = _T("o");
    m_Switches.needDependencies = true;
    m_Switches.forceCompilerUseQuotes = false;
    m_Switches.forceLinkerUseQuotes = false;
    m_Switches.logging = clogSimple;
    m_Switches.libPrefix = _T("lib");
    m_Switches.libExtension = _T("a");
    m_Switches.linkerNeedsLibPrefix = false;
    m_Switches.linkerNeedsLibExtension = false;

    m_Options.ClearOptions();
    m_Options.AddOption(_("Produce debugging symbols"),
                _T("-g"),
                _("Debugging"),
                _T(""),
                true,
                _T("-O -O0 -O1 -O2 -O3 -O4 -O5"),
                _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));

    wxString category = _("Warnings");

    // warnings
    m_Options.AddOption(_("Enable all compiler warnings (overrides every other setting)"), _T("-w"), category);
    // D features
    category = _("D");
    m_Options.AddOption(_("generate documentation"), _T("-D"), category);
    m_Options.AddOption(_("allow deprecated features"), _T("-d"), category);
    m_Options.AddOption(_("compile in debug code"), _T("-d-debug"), category);
    m_Options.AddOption(_("Enable function inlining in -O<N>"), _T("-enable-inlining"), category);
    m_Options.AddOption(_("suppress generation of object file"), _T("-o-"), category);
    m_Options.AddOption(_("compile release version, which means not generating code for contracts and asserts"), _T("-release"), category);
    m_Options.AddOption(_("compile in unittest code, also turns on asserts"), _T("-unittest"), category);
    
    // other
    category = _("Others");
    m_Options.AddOption(_("generate D interface file"), _T("-H"), category);
    m_Options.AddOption(_("verbose"), _T("-v"), category);

    // optimization
    category = _("Optimization");
    m_Options.AddOption(_("Strip all symbols from binary (minimizes size)"), _T(""), category, _T("-s"), true, _T("-g -ggdb"), _("Stripping the binary will strip debugging symbols as well!"));
    m_Options.AddOption(_("Equivalent to -O2"), _T("-O"), category);
    m_Options.AddOption(_("No optimizations (default)"), _T("-O0"), category);
    m_Options.AddOption(_("Simple optimizations"), _T("-O1"), category);
    m_Options.AddOption(_("Good optimizations"), _T("-O2"), category);
    m_Options.AddOption(_("Aggressive optimizations"), _T("-O3"), category);
    m_Options.AddOption(_("Link-time optimization"), _T("-O4"), category);
    m_Options.AddOption(_("Link-time optimization"), _T("-O5"), category);
    // machine dependent options - cpu arch
    category = _("CPU architecture tuning (choose none, or only one of these)");
    m_Options.AddOption(_("i386"), _T("-march=i386"), category);
    m_Options.AddOption(_("i486"), _T("-march=i486"), category);
    m_Options.AddOption(_("Intel Pentium"), _T("-march=i586"), category);
    m_Options.AddOption(_("Intel Pentium (MMX)"), _T("-march=pentium-mmx"), category);
    m_Options.AddOption(_("Intel Pentium PRO"), _T("-march=i686"), category);
    m_Options.AddOption(_("Intel Pentium 2 (MMX)"), _T("-march=pentium2"), category);
    m_Options.AddOption(_("Intel Pentium 3 (MMX, SSE)"), _T("-march=pentium3"), category);
    m_Options.AddOption(_("Intel Pentium 4 (MMX, SSE, SSE2)"), _T("-march=pentium4"), category);
    m_Optio
download for full patch...
afb 2010-08-28 21:42

This looks like a copy/paste of compilerGDC.cpp, and has wrong options

A working version of compilerLDC.cpp is in svn now.