[Documentation] [TitleIndex] [WordIndex

Overview

This is used to manage cmake toolchain modules in a global way for the ros build environment. With it, toolchains can be selected from a library of existing configurations, or created and saved as a user-defined toolchain module.

Usage

The list of commands that can be passed to the toolchain script can be seen below:

> rostoolchain --help
Usage: 
  rostoolchain               : shows the currently set ros toolchain
  rostoolchain clear         : clear the currently set ros toolchain
  rostoolchain create        : create a user-defined toolchain configuration
  rostoolchain delete        : delete a preconfigured toolchain
  rostoolchain help          : print this help information
  rostoolchain list          : list available eros and user-defined toolchains
  rostoolchain select        : interactively select a toolchain
  rostoolchain select <str>  : directly select the specified toolchain
  rostoolchain validate      : attempt to validate a toolchain (not yet implemented)
  
Description: 
  Create/delete and manage the toolchain configuration for this ros environment.
  Location of the user toolchain directory can be modified via --dir or more 
  permanently via /home/snorri/.ros/eros/eros.cfg.

Options:
  -h, --help         show this help message and exit
  -d DIR, --dir=DIR  location of the user toolchain directory.

Creation, and deletion are interactive, selection also if you do not supply an argument. You will be prompted with some questions used to gather data for the toolchain. If you are unsure about some of your answers, this page will explain in some more detail about how to create custom toolchains.

Under the Hood

rostoolchain.cmake

Practically, this manages what is saved in the global ros toolchain file $ROS_ROOT/rostoolchain.cmake. Starting out with cmake toolchains can be a bit bewildering so this eases the process and once familiar, this tool can help easily manage your cross-compile environment.

If you want to know more about how cmake defines toolchain modules, refer to the cmake wiki documentation and look at the pre-defined examples in eros_toolchains.

Toolchain Libraries

There exist several pre-made toolchain modules for popular toolchains in the eros_toolchains package. Alternatively, as mentioned above, you can create custom toolchains which will get added to your own user-defined library.

Patching

It also triggers the application of various patches to the ros tree for cross-compiling when a toolchain is first selected. This is done automatically and is not something the user needs to be aware of.


2024-12-21 14:54