zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Sublime-Text 4 C++ Build-System

C++ system Text build Sublime
2023-06-13 09:18:23 时间
{
    // Windows

    // build only
    "shell_cmd": "g++ -std=c++14 -g -Wall \"${file}\" -o \"${file_base_name}.exe\"",
    // doesn't matter if I use full path
    "working_dir": "${file_path}",
    // only Cpp files can use this sublime-build file
    "selector": "source.c++",
    "variants": [
        {
            // build and run in Terminus (sublime plugin)
            // [Recommanded]
            "name": "Run In Terminus",
            "target": "terminus_exec",
            "cancel": "terminus_cancel_build",
            "shell_cmd": "g++ -std=c++14 -g -Wall \"${file}\" -o \"${file_base_name}.exe\" && cmd /c \"${file_base_name}.exe\""
        },
        {
            // build and run in CMD
            // you can type something in CMD then your progam can get its inputs
            // [Recommanded]
            "name": "Run in CMD",
            "shell_cmd": "g++ -std=c++14 -g -Wall \"${file}\" -o \"${file_base_name}.exe\" && start cmd /c \"\"${file_base_name}.exe\" & pause \""
        },
        {
            // build and run in sublime
            // but you can't input anything to your progam
            "name": "Run in Sublime",
            "shell_cmd": "g++ -std=c++11 -g -Wall \"${file}\" -o \"${file_base_name}.exe\" && cmd /c \"${file_base_name}.exe\""
        }
    ]
}