Cross compilation with Docker and CLion


Anton Khomich
What is cross-compilation
Why docker?
Docker image as a toolchain for CLion
To connect Your docker image to CLion, to be used as a toolchain source, You have to follow these steps:
- Build Your image defined with Dockerfile or pull it from Hub with
docker pull
Make sure You do this with the sudo prefix for all commands. - Open CLion with sudo:
sudo clion .
in the directory where You want to have a project to be located. - Go to settings -> Build, Execution, Deployment -> Toolchains and create a new, Docker based, toolchain configuration.
- Specify a server as docker, go to setting (gear symbol), and make sure that You have a socket specified as "default".
