2013-09-05 40 views

回答

1

阅读Sublime的build systemsmake。两者都是非常强大的工具,并允许进行大量的自定义。您可能需要执行一些shell脚本来将所有内容绑定到一个命令中,但这绝对是可能的,并不那么困难,特别是如果您充分利用built-in variables。现有的C++系统(在Packages/C++/C++.sublime-build提供)应该给你的东西入手:

{ 
    "cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"], 
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", 
    "working_dir": "${file_path}", 
    "selector": "source.c, source.c++", 

    "variants": 
    [ 
     { 
      "name": "Run", 
      "cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"] 
     } 
    ] 
}