Skip to content

Commit

Permalink
Docs: Make CLion instructions less Googler specific
Browse files Browse the repository at this point in the history
Bug: NONE
Change-Id: I9fe62588a7d68d0350867c30b8cc9821a05d167d
Reviewed-on: https://chromium-review.googlesource.com/c/1296685
Commit-Queue: Tommy Li <tommycli@chromium.org>
Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602431}
  • Loading branch information
Tommy C. Li authored and Commit Bot committed Oct 24, 2018
1 parent 5efc472 commit 16826e3
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions docs/clion_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ Prerequisite:

## Setting up CLion

1. Install CLion
1. Authenticate License
- https://g3doc.corp.google.com/devtools/ide/intellij/g3doc/docs/license-server.md?cl=head
1. Install CLion.
- Googlers only: See
[go/intellij-getting-started](https://goto.google.com/intellij-getting-started)
for installation and license authentication instructions.

1. Run CLion

1. Increase CLion's memory allocation
- This step will help performance with large projects
1. Option 1
1. At the startup dialogue, in the bottom right corner, click `configure`
1. At the startup dialogue, in the bottom right corner, click
`Configure`.
1. Setup `Edit Custom VM Options`:
```
-Xss2m
Expand All @@ -38,30 +39,33 @@ Prerequisite:
## Chromium in CLion
1. Import project
- At the startup dialogue, select `Import Project` and select your chromium directory
- At the startup dialog, select `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.
1. Modify the `CMakeList.txt` file
1. Open the `CMakeList.txt` file
1. Modify the `CMakeLists.txt` file
1. Open the `CMakeLists.txt` file
1. Add the following to the top
```
set(CMAKE_BUILD_TYPE Debug)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
```
1. Remove any other `include_directories` the file contains
- the head should look like
```
cmake_minimum_required(VERSION 3.10)
project(chromium)
1. Remove any other `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_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_TYPE Debug)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
add_executable(chromium
...)
```
add_executable(chromium
...)
```
## Building, Running, and Debugging within CLion
Expand Down Expand Up @@ -107,12 +111,12 @@ For some reason, when installing 2018.1 through a package manager, it did not cr
1. Run CLion through the terminal `/opt/clion-2018.1/bin/clion.sh`
1. At the startup dialogue, in the bottom right corner, click `configure`
1. Click `Create Desktop Entry`
## Optional Performance Steps
### Mark directories as `Library Files`
To speed up CLion, you may optionally mark directories such as `src/third_party` as `Library Files`
1. Open the `Project` navigation (default `Alt 1`)
1. Right click the directory > `Mark directory as` > `Library Files`
1. See `https://blog.jetbrains.com/clion/2015/12/mark-dir-as/` for more details
1. See `https://blog.jetbrains.com/clion/2015/12/mark-dir-as/` for more details

0 comments on commit 16826e3

Please sign in to comment.