Test environment:
Sublime text version 2.0.2, build 2221 and Sublime text stable channel, build 3065 (Version3)
Win7 64-bit
android-ndk-r10c Windows x86_64
Steps:
1. Set the NDK environment variable
If you extract the NDK compression package to D:\android-ndk-r10c,
environment variable, advanced system settings, advanced systems, Control Panel----Select path in the system variable, and click Edit button to add the end of the variable value:
;D: \android-ndk-r10c
Note Multiple values are separated by semicolons.
All the way to determine.
2. Build a good Sublimeproject
The simplest way is to open the root folder of the code and then click Menu Project, Save Project as ... A name is saved in the root folder of the code (the save location is arbitrary, the path in the later steps corresponds to the change).
3. Add Build_systems to Project
Edit the file and save it in the Sublime menu project, edit Project. Edit into this:
{"Folders": [{"Follow_symlinks": True, "path": "."}], "Build_systems": [ { "name": "Ndk-build-subl2 ", " cmd ":" BUILD.bat " }, { " name ":" Ndk-build ", " Shell_cmd ":" Ndk-build-j5 ", " Working_dir ":" ${project_path}/android_project " } ]}
Sublime Text 2 and 3 are different, there are two settings in Build_systems,depending on the version number you use, keep one of them。
Thename of Ndk-build is sublime text 3 , can see Shell_cmd is called Ndk-build,working_dir is the initial path to set the command line, Can be filled in Androidproject path, where ${project_path} is a reserved variable of sublime text, referring to the folder of this sublime Textproject file (note, sublime Textproject paths and androidproject paths are two concepts, don't confuse them.
the name ndk-build-subl2 is sublime text 2 , I have tried many times can not directly call Ndk-build, so is to call the BUILD.bat script under the same folder, the content of this script is:
CD Android_projectndk-build-j5
4. Set up the build System
Sublime Menu Tools, Build System, select Ndk-build or NDK-BUILD-SUBL2. The new option here is to read the settings from the previous step before it appears.
This is OK, choose Build or CTRL + B in the menu will compile, sublime text itself will pop up the form to show the result of the build.
Tread a few pits to sum up, assuming that encountered problems welcome message exchange.
PS: To compile so in Linux sublimetext3, change "Shell_cmd" to ". ~/.bashrc;ndk-build-j5 "will be able,. BASHRC to export the NDK path
Reprint Please specify Source:http://blog.csdn.net/hursing
Windows Sublimetext uses NDK to compile Android so (without Cygwin)