CLion is an IDE
Prerequisite: Checking out and building the chromium code base
Install CLion.
Run CLion
Increase CLion's memory allocation
Configure
.Edit Custom VM Options
:-Xss2m -Xms1g -Xmx5g
Edit Custom Properties
:idea.max.intellisense.filesize=12500
VM Options
and Properties
in the configure
menu. Instead:Create New Project
Help
> Edit Custom VM Options
Help
> Edit Custom Properties
Import project
Import Project
and select your chromium
directory; this should be the parent directory to src
. Selecting src
instead would result in a bunch of CLion IDE files appearing in your repository.Modify the CMakeLists.txt
file
CMakeLists.txt
fileset(CMAKE_BUILD_TYPE Debug) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories
the file contains. The beginning of the file should now 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 ...)
Run
> Edit Configurations
+
in the top left and select Application
Target: All targets Executable: src/out/Defaults/chrome Program arguments (optional): --disable-seccomp-sandbox --single-process Working directory: .../chromium/src/out/Default
+
next to the Before launch
section and select Run External tool
+
and setup:Program: .../depot_tools/ninja Arguments: -C out/Default -j 1000 chrome Working directory: .../chromium/src
OK
to close all three dialogsRun
> Run
or Run
> 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:
cd /usr/share/applications/
touch clion-2018-1.desktop
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
/opt/clion-2018.1/bin/clion.sh
configure
Create Desktop Entry
Library Files
To speed up CLion, you may optionally mark directories such as src/third_party
as Library Files
Project
navigation (default Alt 1
)Mark directory as
> Library Files
https://blog.jetbrains.com/clion/2015/12/mark-dir-as/
for more details