-
Notifications
You must be signed in to change notification settings - Fork 9
Compiling the code
Here is the easy way to get hacking on GRX3 using VSCode.
Currently, this is only working on Linux. Mac is coming soon. Windows - help wanted.
-
If you don't already have VSCode installed, get it from the link above.
-
Open a new window in VSCode.
-
If you haven't already cloned the git repository, click Clone Git Repository...
Follow the instructions in VSCode to finish cloning. You can find the URL on GitHub.
-
Open the folder where you cloned the repository in VSCode. (If you cloned the repository using VSCode, it will ask if you want to open this folder as the last step.)
-
Next, install the recommended extensions. Open the command pallette (F1 or CTRL+SHIFT+P) and type
recommended
, then select Extensions: Show Workspace Recommended Extensions.Install each of the listed extensions if they are not already installed.
-
Now, we need to install the build dependencies. Open a terminal in VSCode (CTRL+`) and run...
On Debian/Ubuntu:
./setup.deb.py
-
Then we need to setup the build directory. In the terminal, run...
cmake -P setup.cmake
-
Now, we are good to go. Let's try debugging a python file. Open one of the python files in
example/python/
and set a breakpoint by clicking in the margin to the left of the line numbers.Then select the debugger pane. Make sure Run python file is selected from the drop-down box, then click the green arrow to run. If all goes well, the code should compile and then the python program will run and stop on the breakpoint.
Get the code (beware of the git submodules):
git clone https://github.com/ev3dev/grx
cd grx
git submodule update --init --depth 1 -- cmake
# there is also a submodule for the generated html docs used by readthedocs.org
# but you are just wasting bandwidth if you check it out, you can ignore it...
git update-index --assume-unchanged doc/sphinx/_html_extra
Get the build dependencies:
# Debian/Ubuntu
./setup.deb.py
# Other platforms: TODO
Now create a build directory:
mkdir build
cd build
Then build it:
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
All of the example programs have run-*
targets, so you can run them using make. Example:
make run-python-paint