⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compilerow.cpp

📁 非常好用的可移植的多平台C/C++源代码编辑器
💻 CPP
📖 第 1 页 / 共 2 页
字号:
#ifdef __WXMSW__
// this compiler is valid only in windows

#include <sdk.h>
#include "compilerOW.h"
#include <wx/log.h>
#include <wx/intl.h>
#include <wx/regex.h>
#include <wx/config.h>
#include <wx/utils.h>

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

#include <configmanager.h>
#include <messagemanager.h>
#include <manager.h>

#include <wx/utils.h>
#include <wx/filefn.h>

CompilerOW::CompilerOW()
    : Compiler(wxT("OpenWatcom (W32) Compiler"))
{
    Reset();
}

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

Compiler * CompilerOW::CreateCopy()
{
    return new CompilerOW(*this);
}

void CompilerOW::Reset()
{
    /*
     *  Define compiler suite programs. I have chosen to use wcl386 for all
     *  to provide as consistent a set of options as possible.
     */

	m_Programs.C                = wxT("wcl386.exe");
	m_Programs.CPP              = wxT("wcl386.exe");
	m_Programs.LD               = wxT("wcl386.exe");
	m_Programs.LIB              = wxT("wlib.exe");
	m_Programs.WINDRES          = wxT("wrc.exe");
	m_Programs.MAKE             = wxT("mingw32-make.exe");

	m_Switches.includeDirs      = wxT("-i");
	m_Switches.libDirs          = wxT("-L");
	m_Switches.linkLibs         = wxT("");
	m_Switches.libPrefix        = wxT("");
	m_Switches.libExtension     = wxT("lib");
	m_Switches.defines          = wxT("-d");
	m_Switches.genericSwitch    = wxT("-");
	m_Switches.objectExtension  = wxT("obj");

	m_Switches.needDependencies = false;
	m_Switches.forceCompilerUseQuotes = false;
	m_Switches.forceLinkerUseQuotes = false;
	m_Switches.logging = clogSimple;
	m_Switches.buildMethod = cbmDirect;
	m_Switches.linkerNeedsLibPrefix = false;
	m_Switches.linkerNeedsLibExtension = true;

    m_Options.ClearOptions();
//	m_Options.AddOption(_("Produce debugging symbols"),
//				"-g",
//				_("Debugging"),
//				"",
//				true,
//				"-o -o+space",
//				_("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));


    wxString   category = wxT("General");

    m_Options.AddOption(wxT("treat source files as C code"), wxT("-cc"), category);
    m_Options.AddOption(wxT("treat source files as C++ code"), wxT("-cc++"), category);
    m_Options.AddOption(wxT("ignore the WCL386 environment variable"), wxT("-y"), category);


    category = wxT("Processor options");
    m_Options.AddOption(wxT("386 register calling conventions"), wxT("-3r"), category);
    m_Options.AddOption(wxT("386 stack calling conventions"), wxT("-3s"), category);
    m_Options.AddOption(wxT("486 register calling conventions"), wxT("-4r"), category);
    m_Options.AddOption(wxT("486 stack calling conventions"), wxT("-4s"), category);
    m_Options.AddOption(wxT("Pentium register calling conventions"), wxT("-5r"), category);
    m_Options.AddOption(wxT("Pentium stack calling conventions"), wxT("-5s"), category);
    m_Options.AddOption(wxT("Pentium Pro register call conventions"), wxT("-6r"), category);
    m_Options.AddOption(wxT("Pentium Pro stack call conventions"), wxT("-6s"), category);

    category = wxT("Floating-point processor options");

    m_Options.AddOption(wxT("calls to floating-point library"), wxT("-fpc"), category);
    m_Options.AddOption(wxT("enable Pentium FDIV check"), wxT("-fpd"), category);
    m_Options.AddOption(wxT("inline 80x87 with emulation"), wxT("-fpi"), category);
    m_Options.AddOption(wxT("inline 80x87"), wxT("-fpi87"), category);
    m_Options.AddOption(wxT("use old floating-point conventions"), wxT("-fpr"), category);
    m_Options.AddOption(wxT("generate 287 floating-point code"), wxT("-fp2"), category);
    m_Options.AddOption(wxT("generate 387 floating-point code"), wxT("-fp3"), category);
    m_Options.AddOption(wxT("optimize floating-point for Pentium"), wxT("-fp5"), category);
    m_Options.AddOption(wxT("optimize floating-point for Pentium Pro"), wxT("-fp6"), category);

    category = wxT("Compiler options");

    m_Options.AddOption(wxT("compile and link for DOS"), wxT("-bcl=dos"), category);
    m_Options.AddOption(wxT("compile and link for Linux"), wxT("-bcl=linux"), category);
    m_Options.AddOption(wxT("compile and link for NT (includes Win32)"), wxT("-bcl=nt"), category);
    m_Options.AddOption(wxT("compile and link for OS/2"), wxT("-bcl=os2"), category);
    m_Options.AddOption(wxT("compile and link for QNX"), wxT("-bcl=qnx"), category);
    m_Options.AddOption(wxT("compile and link for Windows"), wxT("-bcl=windows"), category);

    m_Options.AddOption(wxT("compile for DOS"), wxT("-bt=dos"), category);
    m_Options.AddOption(wxT("compile for Linux"), wxT("-bt=linux"), category);
    m_Options.AddOption(wxT("compile for NetWare"), wxT("-bt=netware"), category);
    m_Options.AddOption(wxT("compile for NetWare 5 and later"), wxT("-bt=netware5"), category);
    m_Options.AddOption(wxT("compile for NT (includes Win32)"), wxT("-bt=nt"), category);
    m_Options.AddOption(wxT("compile for OS/2"), wxT("-bt=os2"), category);
    m_Options.AddOption(wxT("compile for QNX"), wxT("-bt=qnx"), category);
    m_Options.AddOption(wxT("compile for Windows"), wxT("-bt=windows"), category);


    m_Options.AddOption(wxT("generate browsing information"), wxT("-db"), category);
    m_Options.AddOption(wxT("set error limit number (set ERROR_LIMIT in custom variables)"), wxT("-e=$(ERROR_LIMIT)"), category);
    m_Options.AddOption(wxT("call epilogue hook routine"), wxT("-ee"), category);
    m_Options.AddOption(wxT("full paths in messages"), wxT("-ef"), category);
    m_Options.AddOption(wxT("force enums to be type int"), wxT("-ei"), category);
    m_Options.AddOption(wxT("minimum base type for enum is int"), wxT("-em"), category);
    m_Options.AddOption(wxT("emit routine names in the code"), wxT("-en"), category);
    m_Options.AddOption(wxT("call prologue hook routine"), wxT("-ep"), category);
    m_Options.AddOption(wxT("call prologue hook routine with n bytes of stack (set PROLOGUE_STACK in custom variables)"), wxT("-ep=$(PROLOGUE_STACK)"), category);
    m_Options.AddOption(wxT("do not display error messages"), wxT("-eq"), category);
    m_Options.AddOption(wxT("P5 profiling"), wxT("-et"), category);
    m_Options.AddOption(wxT("generate PharLap EZ-OMF object"), wxT("-ez"), category);
    m_Options.AddOption(wxT("generate pre-compiled header (set PCH_FILE in custom variables)"), wxT("-fh=$(PCH_FILE)"), category);
    m_Options.AddOption(wxT("generate pre-compiled header (Quiet) (set PCH_FILE in custom variables)"), wxT("-fhq=$(PCH_FILE)"), category);
    m_Options.AddOption(wxT("(C++) only read PCH"), wxT("-fhr"), category);
    m_Options.AddOption(wxT("(C++) only write PCH"), wxT("-fhw"), category);
    m_Options.AddOption(wxT("(C++) don't count PCH warnings"), wxT("-fhwe"), category);

    // This should be a multiple option. We can define multiple force includes
    m_Options.AddOption(wxT("force include of file (define FORCE_INCLUDE in custom variables)"), wxT("-fi=$(FORCE_INCLUDE)"), category);
    // This one is mandatory in the ctCompileObjectCmd
    //m_Options.AddOption(wxT("set object file name"), wxT("-fo=<file>"), category);
    m_Options.AddOption(wxT("set error file name (define ERROR_FILE in custom variables)"), wxT("-fr=$(ERROR_FILE)"), category);
    m_Options.AddOption(wxT("(C++) check for 8.3 file names"), wxT("-ft"), category);
    m_Options.AddOption(wxT("(C++) no check for 8.3 file names"), wxT("-fx"), category);
    m_Options.AddOption(wxT("set code group name (define CODEGROUP in custom variables)"), wxT("-g=$(CODEGROUP)"), category);
    m_Options.AddOption(wxT("codeview debug format"), wxT("-hc"), category);
    m_Options.AddOption(wxT("dwarf debug format"), wxT("-hd"), category);
    m_Options.AddOption(wxT("watcom debug format"), wxT("-hw"), category);
    m_Options.AddOption(wxT("change char default to signed"), wxT("-j"), category);
    m_Options.AddOption(wxT("memory model flat"), wxT("-mf"), category);
    m_Options.AddOption(wxT("memory model small"), wxT("-ms"), category);
    m_Options.AddOption(wxT("memory model medium"), wxT("-mm"), category);
    m_Options.AddOption(wxT("memory model compact"), wxT("-mc"), category);
    m_Options.AddOption(wxT("memory model large"), wxT("-ml"), category);
    m_Options.AddOption(wxT("memory model huge"), wxT("-mh"), category);
    m_Options.AddOption(wxT("set CODE class name (define CODECLASS in custom variables)"), wxT("-nc=$(CODECLASS)"), category);
    m_Options.AddOption(wxT("set data segment name (define DATANAME in custom variables)"), wxT("-nd=$(DATANAME)"), category);
    m_Options.AddOption(wxT("set module name (define MODULENAME in custom variables)"), wxT("-nm=$(MODULENAME)"), category);
    m_Options.AddOption(wxT("set text segment name (define TEXTNAME in custom variables)"), wxT("-nt=$(TEXTNAME)"), category);
    m_Options.AddOption(wxT("save/restore segregs across calls"), wxT("-r"), category);
    m_Options.AddOption(wxT("promote function args/rets to int"), wxT("-ri"), category);
    m_Options.AddOption(wxT("remove stack overflow checks"), wxT("-s"), category);
    m_Options.AddOption(wxT("generate calls to grow the stack"), wxT("-sg"), category);
    m_Options.AddOption(wxT("touch stack through SS first"), wxT("-st"), category);
    m_Options.AddOption(wxT("output func declarations to .def"), wxT("-v"), category);
    m_Options.AddOption(wxT("VC++ compat: alloca allowed in arg lists"), wxT("-vcap"), category);
    m_Options.AddOption(wxT("set warning level to 0 (suppress warnings)"), wxT("=w=0"), category);
    m_Options.AddOption(wxT("set warning level to 1"), wxT("-w=1"), category);
    m_Options.AddOption(wxT("set warning level to 2"), wxT("-w=2"), category);
    m_Options.AddOption(wxT("set warning level to 3"), wxT("-w=3"), category);
    m_Options.AddOption(wxT("disable warning message (define DIS_WARN in custom variables)"), wxT("-wcd=$(DIS_WARN)"), category);
    m_Options.AddOption(wxT("enable warning message (define ENA_WARN in custom variables)"), wxT("-wce=$(ENA_WARN)"), category);
    m_Options.AddOption(wxT("treat all warnings as errors"), wxT("-we"), category);
    m_Options.AddOption(wxT("set warning level to max"), wxT("-wx"), category);
    m_Options.AddOption(wxT("(C++) enable RTTI"), wxT("-xr"), category);
    m_Options.AddOption(wxT("disable language extensions (ANSI/ISO compliance)"), wxT("-za"), category);
    m_Options.AddOption(wxT("enable language extensions"), wxT("-ze"), category);
    m_Options.AddOption(wxT("place strings in CODE segment"), wxT("-zc"), category);
    m_Options.AddOption(wxT("DS not pegged to DGROUP"), wxT("-zdf"), category);
    m_Options.AddOption(wxT("DS pegged to DGROUP"), wxT("-zdp"), category);
    m_Options.AddOption(wxT("load DS directly from DGROUP"), wxT("-zdl"), category);
    m_Options.AddOption(wxT("Allow code-generator to use FS"), wxT("-zff"), category);
    m_Options.AddOption(wxT("Do not allow code-generator to use FS"), wxT("-zfp"), category);
    m_Options.AddOption(wxT("Allow code-generator to use GS"), wxT("-zgf"), category);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -