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

📄 compilerow.cpp

📁 非常好用的可移植的多平台C/C++源代码编辑器
💻 CPP
📖 第 1 页 / 共 2 页
字号:
    m_Options.AddOption(wxT("Do not allow code-generator to use GS"), wxT("-zgp"), category);
    m_Options.AddOption(wxT("Allow arithmetic on void derived type"), wxT("-zev"), category);
    m_Options.AddOption(wxT("function prototype using base type"), wxT("-zg"), category);
    // Duplicate to -zk0
    //m_Options.AddOption(wxT("Double byte chars in strings (Japanese DBCS)"), wxT("-zk"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Japanese DBCS)"), wxT("-zk0"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Japanese DBCS - translate to Unicode)"), wxT("-zk0u"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Trad Chinese or Taiwanese DBCS)"), wxT("-zk1"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Korean Hangeul) DBCS)"), wxT("-zk2"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Use current code page)"), wxT("-zkl"), category);
    m_Options.AddOption(wxT("Translate characters to Unicode (specify UNI_CP in custom variables)"), wxT("-zku=$(UNI_CP)"), category);
    m_Options.AddOption(wxT("remove default library information"), wxT("-zl"), category);
    m_Options.AddOption(wxT("remove file dependency information"), wxT("-zld"), category);
    m_Options.AddOption(wxT("place functions in separate segments"), wxT("-zm"), category);
    m_Options.AddOption(wxT("(C++) zm with near calls allowed"), wxT("-zmf"), category);
    m_Options.AddOption(wxT("struct packing align 1 byte"), wxT("-zp1"), category);
    m_Options.AddOption(wxT("struct packing align 2 byte"), wxT("-zp2"), category);
    m_Options.AddOption(wxT("struct packing align 4 byte"), wxT("-zp4"), category);
    m_Options.AddOption(wxT("struct packing align 8 byte"), wxT("-zp8"), category);
    m_Options.AddOption(wxT("struct packing align 16 byte"), wxT("-zp16"), category);
    m_Options.AddOption(wxT("warning when padding a struct"), wxT("-zpw"), category);
    m_Options.AddOption(wxT("operate quietly"), wxT("-zq"), category);
    m_Options.AddOption(wxT("check syntax only"), wxT("-zs"), category);
    m_Options.AddOption(wxT("set data threshold (set DATA_THRESHOLD in custom variables)"), wxT("-zt=$(DATA_THRESHOLD)"), category);
    m_Options.AddOption(wxT("Do not assume SS contains DGROUP"), wxT("-zu"), category);
    m_Options.AddOption(wxT("(C++) enable virt. fun. removal opt"), wxT("-zv"), category);
    m_Options.AddOption(wxT("generate code for MS Windows"), wxT("-zw"), category);
    m_Options.AddOption(wxT("remove @size from __stdcall func."), wxT("-zz"), category);

    category = wxT("Debugging options");

    m_Options.AddOption(wxT("no debugging information"), wxT("-d0"), category);
    m_Options.AddOption(wxT("line number debugging information"), wxT("-d1"), category);
    m_Options.AddOption(wxT("(C) line number debugging information plus typing information for global symbols and local structs and arrays"), wxT("-d1+"), category);
    m_Options.AddOption(wxT("full symbolic debugging information"), wxT("-d2"), category);
    m_Options.AddOption(wxT("(C++) d2 and debug inlines; emit inlines as external out-of-line functions"), wxT("-d2i"), category);
    m_Options.AddOption(wxT("(C++) d2 and debug inlines; emit inlines as static out-of-line functions"), wxT("-d2s"), category);
    m_Options.AddOption(wxT("(C++) d2 but without type names"), wxT("-d2t"), category);
    m_Options.AddOption(wxT("full symbolic debugging with unreferenced type names"), wxT("-d3"), category);
    m_Options.AddOption(wxT("(C++) d3 plus debug inlines; emit inlines as external out-of-line functions"), wxT("-d3i"), category);
    m_Options.AddOption(wxT("(C++) d3 plus debug inlines; emit inlines as static out-of-line functions"), wxT("-d3s"), category);

    category = wxT("Optimization options");

    m_Options.AddOption(wxT("relax alias checking"), wxT("-oa"), category);
    m_Options.AddOption(wxT("branch prediction"), wxT("-ob"), category);
    m_Options.AddOption(wxT("disable call/ret optimization"), wxT("-oc"), category);
    m_Options.AddOption(wxT("disable optimizations"), wxT("-od"), category);
    m_Options.AddOption(wxT("expand functions inline (specify INLINE_NUM in custom variables)"), wxT("-oe=$(INLINE_NUM)"), category);
    m_Options.AddOption(wxT("generate traceable stack frames"), wxT("-of"), category);
    m_Options.AddOption(wxT("always generate traceable stack frames"), wxT("-of+"), category);
    m_Options.AddOption(wxT("enable repeated optimizations"), wxT("-oh"), category);
    m_Options.AddOption(wxT("inline intrinsic functions"), wxT("-oi"), category);
    m_Options.AddOption(wxT("(C++) oi with max inlining depth"), wxT("-oi+"), category);
    m_Options.AddOption(wxT("control flow entry/exit sequence"), wxT("-ok"), category);
    m_Options.AddOption(wxT("perform loop optimizations"), wxT("-ol"), category);
    m_Options.AddOption(wxT("ol with loop unrolling"), wxT("-ol+"), category);
    m_Options.AddOption(wxT("generate inline math functions"), wxT("-om"), category);
    m_Options.AddOption(wxT("numerically unstable floating-point"), wxT("-on"), category);
    m_Options.AddOption(wxT("continue compile when low on memory"), wxT("-oo"), category);
    m_Options.AddOption(wxT("improve floating-point consistency"), wxT("-op"), category);
    m_Options.AddOption(wxT("re-order instructions to avoid stalls"), wxT("-or"), category);
    m_Options.AddOption(wxT("optimize for space"), wxT("-os"), category);
    m_Options.AddOption(wxT("optimize for time"), wxT("-ot"), category);
    m_Options.AddOption(wxT("ensure unique addresses for functions"), wxT("-ou"), category);
    m_Options.AddOption(wxT("maximum optimization (-obmiler -s)"), wxT("-ox"), category);

    category = wxT("C++ exception handling options");

    m_Options.AddOption(wxT("no exception handling"), wxT("-xd"), category);
    m_Options.AddOption(wxT("no exception handling: space"), wxT("-xds"), category);
    // duplicate to -xd
    //m_Options.AddOption(wxT("no exception handling"), wxT("-xdt"), category);
    m_Options.AddOption(wxT("exception handling: balanced"), wxT("-xs"), category);
    m_Options.AddOption(wxT("exception handling: space"), wxT("-xss"), category);
    m_Options.AddOption(wxT("exception handling: time"), wxT("-xst"), category);

    category = wxT("Preprocessor options");

    //  defined in m_Switches.defines
    //  m_Options.AddOption(wxT("Define macro"), wxT("-d"), category);
    // difficult to support
    //  m_Options.AddOption(wxT("Extend -d syntax"), wxT(""), category);
    //  This one is mandatory in the ctCompileObjectCmd
    //  m_Options.AddOption(wxT("set object file name"), wxT("-fo=<file>"), category);
    //  Specified by m_Switches.includeDirs
    //  m_Options.AddOption(wxT("include directory"), wxT("-i"), category);
    m_Options.AddOption(wxT("number of spaces in tab stop (set TAB_STOP in custom variables)"), wxT("-t=$(TAB_STOP)"), category);
    // multi-option
    //m_Options.AddOption(wxT("set #pragma on"), wxT("-tp=$(PRAGMA_NAMES)"), category);
    // multi-option
    //m_Options.AddOption(wxT("undefine macro name"), wxT("-u"), category);
    /*
     *  options are -pcelw=n
     */
    m_Options.AddOption(wxT("preprocess source file"), wxT("-p"), category);
    m_Options.AddOption(wxT("preprocess source file (preserve comments)"), wxT("-pc"), category);
    m_Options.AddOption(wxT("preprocess source file (insert #line directives)"), wxT("-pl"), category);
    m_Options.AddOption(wxT("(C++) preprocess file (encrypt identifiers)"), wxT("-pe"), category);
    //

    category = wxT("Linker options");

    m_Options.AddOption(wxT("build Dynamic link library"), wxT("-bd"), category);
    m_Options.AddOption(wxT("build Multi-thread application"), wxT("-bm"), category);
    m_Options.AddOption(wxT("build with dll run-time library"), wxT("-br"), category);
    m_Options.AddOption(wxT("build default Windowing appllication"), wxT("-bw"), category);
    m_Options.AddOption(wxT("write directives"), wxT("-fd"), category);
    m_Options.AddOption(wxT("write directives (define DIRECTIVE_FILE in custom variables)"), wxT("-fd=$(DIRECTIVE_FILE)"), category);
    // mandatory in link commands
    //m_Options.AddOption(wxT("name executable file"), wxT("-fe=<file>"), category);
    m_Options.AddOption(wxT("generate map file"), wxT("-fm"), category);
    m_Options.AddOption(wxT("generate map file (define MAP_FILE in custom variables)"), wxT("-fm=$(MAP_FILE)"), category);
    m_Options.AddOption(wxT("set stack size (define STACK_SIZE in custom variables)"), wxT("-k$(STACK_SIZE)"), category);
    m_Options.AddOption(wxT("link for the specified OS (define TARGET_OS in custom variables)"), wxT("-l=$(TARGET_OS)"), category);
    m_Options.AddOption(wxT("make names case sensitive"), wxT("-x"), category);
    m_Options.AddOption(wxT("additional directive file (specify LINK_DIRECTIVES in custom variables)"), wxT("@$(LINK_VARIABLES)"), category);
    // ????
    // m_Options.AddOption(wxT("following parameters are linker options"), wxT("-"), category);


    m_Commands[(int)ctCompileObjectCmd]
        = wxT("$compiler -c $options $includes -fo=$object $file");
    m_Commands[(int)ctCompileResourceCmd]
        = wxT("$rescomp -fo=$resource_output $res_includes $file");
    m_Commands[(int)ctLinkExeCmd]
        = wxT("$linker $link_options $libdirs $link_objects -fe=$exe_output $libs $link_resobjects");
    m_Commands[(int)ctLinkConsoleExeCmd]
        = wxT("$linker $link_options $libdirs $link_objects -fe=$exe_output $libs $link_resobjects");
    m_Commands[(int)ctLinkDynamicCmd]
        = wxT("$linker -$libdirs -fe=$exe_output $libs $link_objects $link_options");
    m_Commands[(int)ctLinkStaticCmd]
        = wxT("$lib_linker $static_output $link_objects");

    LoadDefaultRegExArray();

    m_CompilerOptions.Clear();
    m_LinkerOptions.Clear();
    m_LinkLibs.Clear();
    m_CmdsBefore.Clear();
    m_CmdsAfter.Clear();
}

void CompilerOW::LoadDefaultRegExArray()
{
    m_RegExes.Clear();
    m_RegExes.Add(RegExStruct(_("Note"), cltError, wxT("([A-Za-z0-9_:/\\.-]+)\\(([0-9]+)\\): Note! (.+)"), 3, 1, 2));
    m_RegExes.Add(RegExStruct(_("Compiler error"), cltError, wxT("([A-Za-z0-9_:/\\.-]+)\\(([0-9]+)\\): Error! (.+)"), 3, 1, 2));
    m_RegExes.Add(RegExStruct(_("Compiler warning"), cltWarning, wxT("([A-Za-z0-9_:/\\.-]+)\\(([0-9]+)\\): Warning! (.+)"), 3, 1, 2));
}

AutoDetectResult CompilerOW::AutoDetectInstallationDir()
{
#ifdef __WXMSW__
    wxLogNull ln;
    wxRegKey key; // defaults to HKCR
    key.SetName(wxT("HKEY_LOCAL_MACHINE\\Software\\Open Watcom\\c_1.0"));
    if (key.Open())
        // found; read it
        key.QueryValue(wxT("Install Location"), m_MasterPath);

    if (m_MasterPath.IsEmpty())
        // just a guess; the default installation dir
        m_MasterPath = wxT("C:\\watcom");

    if (!m_MasterPath.IsEmpty())
    {
        AddIncludeDir(m_MasterPath + wxFILE_SEP_PATH + wxT("h"));
        AddIncludeDir(m_MasterPath + wxFILE_SEP_PATH + wxT("h") + wxFILE_SEP_PATH + wxT("nt"));
        m_ExtraPaths.Add(m_MasterPath + wxFILE_SEP_PATH + wxT("binnt"));
        m_ExtraPaths.Add(m_MasterPath + wxFILE_SEP_PATH + wxT("binw"));
    }
#endif
    wxSetEnv(wxT("WATCOM"), m_MasterPath);

    return wxFileExists(m_MasterPath + wxFILE_SEP_PATH + wxT("binnt") + wxFILE_SEP_PATH + m_Programs.C) ? adrDetected : adrGuessed;
}

void CompilerOW::LoadSettings(const wxString& baseKey)
{
    Compiler::LoadSettings(baseKey);
    wxSetEnv(wxT("WATCOM"), m_MasterPath);
}

void CompilerOW::SetMasterPath(const wxString& path)
{
    Compiler::SetMasterPath(path);
    wxSetEnv(wxT("WATCOM"), m_MasterPath);
}

#endif // __WXMSW__

⌨️ 快捷键说明

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