CLion is an IDE
Prerequisite: Checking out and building the chromium code base
[TOC]
-
Install CLion
-
Authenticate License
-
Run CLion
-
Increase CLion's memory allocation
- This step will help performance with large projects
- Option 1
- At the startup dialogue, in the bottom right corner, click
configure
- Setup
Edit Custom VM Options
:-Xss2m -Xms1g -Xmx5g
- Setup
Edit Custom Properties
:idea.max.intellisense.filesize=12500
- At the startup dialogue, in the bottom right corner, click
- Option 2; 2017 and prior versions may not include the options to setup your
VM Options
andProperties
in theconfigure
menu. Instead:Create New Project
Help
>Edit Custom VM Options
Help
>Edit Custom Properties
-
Import project
- At the startup dialogue, select
Import Project
and select your chromium directory
- At the startup dialogue, select
-
Modify the
CMakeList.txt
file- Open the
CMakeList.txt
file - Add the following to the top
set(CMAKE_BUILD_TYPE Debug) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
- Remove any other
include_directories
the file contains- the head should look like
cmake_minimum_required(VERSION 3.10) project(chromium) set(CMAKE_CXX_STANDARD 11) set(CMAKE_BUILD_TYPE Debug) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) add_executable(chromium ...)
- the head should look like
- Open the
Run
>Edit Configurations
- Click
+
in the top left and selectApplication
- Setup:
Target: All targets Executable: src/out/Defaults/chrome Program arguments (optional): --disable-seccomp-sandbox --single-process Working directory: .../chromium/src/out/Default
- Click
+
next to theBefore launch
section and selectRun External tool
- In the dialog that appears, click
+
and setup:Program: .../depot_tools/ninja Arguments: -C out/Default -j 1000 chrome Working directory: .../chromium/src
- Click
OK
to close all three dialogs Run
>Run
orRun
>Debug
For some reason, when installing 2018.1 through a package manager, it did not create a desktop entry when I tried it. If you experience this as well:
- Option 1
cd /usr/share/applications/
touch clion-2018-1.desktop
- open
clion-2018-1.desktop
and insert:[Desktop Entry] Name=CLion 2018.1 Exec=/opt/clion-2018.1/bin/clion.sh %u Icon=/opt/clion-2018.1/bin/clion.svg Terminal=false Type=Application Categories=Development;IDE;Java; StartupWMClass=jetbrains-clion X-Desktop-File-Install-Version=0.23
- Option 2
- Run CLion through the terminal
/opt/clion-2018.1/bin/clion.sh
- At the startup dialogue, in the bottom right corner, click
configure
- Click
Create Desktop Entry
- Run CLion through the terminal
To speed up CLion, you may optionally mark directories such as src/third_party
as Library Files
- Open the
Project
navigation (defaultAlt 1
) - Right click the directory >
Mark directory as
>Library Files
- See
https://blog.jetbrains.com/clion/2015/12/mark-dir-as/
for more details