Sublime Forum

ST3: C++ default build settings and package control messages

#1

I’m trying to change the compiler options when building C++ files in Sublime Text 3 on MacOS 10.8.4.

I found /Library/Application Support and /Applications/Sublime Text.app/Contents/MacOS/Packages/C++.sublime-package and copied it to my home directory. From there I unzipped it, and changed C++.sublime-build to:

{
“shell_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",
		"shell_cmd": "clang++ \"${file}\""
	}
]

}

Then I created the directory /Applications/Sublime Text.app/Contents/MacOS/Packages/C++ and placed this file there, and restarted ST3.

However, the settings haven’t taken, because doing Run creates the executable with the same name as the source file (the default), instead of “a.out” (the default for clang++). What did I do wrong?

For my second question I submitted it to github.com/wbond/sublime_packag … issues/582

0 Likes