aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorYuri Wiitala <miu@chromium.org>2020-01-09 18:36:09 -0800
committerYuri Wiitala <miu@chromium.org>2020-01-10 22:08:19 +0000
commit50d8abc87806ee09096318c51b07fefb7cad1f5f (patch)
tree875a68e4850e9aa8665a922912098b42950dc89c /README.md
parent80fd1cdeb5b6928084532164065d3cb0cbb8ff2f (diff)
downloadopenscreen-50d8abc87806ee09096318c51b07fefb7cad1f5f.tar.gz
Update buildtools DEPS revision, add hooks; and fix GN libs prefix.
Moves the buildtools dependency to the latest commit (8d2132841536523249669813b928e29144d487f9), and adds hooks for auto-downloading clang-format. Then, fixes a GN-internal change that broke the linker command line for specifying external libraries. Also, shucked the tools/install-build-tools.sh script, removing the unnecessary ninja download (it's in depot_tools now), and the clang-format download. The result of all this is that all developers will be using the correct versions of all development and build tools, and upgrades can easily be managed via changes to the DEPS file from here onwards. NOTE: Developers will want to run `rm -rf buildtools/ && gclient sync` to ensure they have a clean/consistent checkout with the correct tools/revisions. Bug: openscreen:95 Change-Id: I5028d9f97f11a62f0a10d3edf8f46631e72a6ae6 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1988936 Reviewed-by: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org> Reviewed-by: Yuri Wiitala <miu@chromium.org>
Diffstat (limited to 'README.md')
-rw-r--r--README.md48
1 files changed, 30 insertions, 18 deletions
diff --git a/README.md b/README.md
index 0d9fd115..aa77b33e 100644
--- a/README.md
+++ b/README.md
@@ -26,22 +26,28 @@ lint` and `git cl upload.`
## Checking out code
-From the parent directory of where you want the openscreen checkout, configure
-`gclient` and check out openscreen with the following commands:
+From the parent directory of where you want the openscreen checkout (e.g.,
+`~/my_project_dir`), configure `gclient` and check out openscreen with the
+following commands:
```bash
+ cd ~/my_project_dir
gclient config https://chromium.googlesource.com/openscreen
gclient sync
```
-Now, you should have `openscreen/` repository checked out, with all dependencies
-checked out to their appropriate revisions.
+The first `gclient` command will create a default .gclient file in
+`~/my_project_dir` that describes how to pull down the `openscreen` repository.
+The second command creates an `openscreen/` subdirectory, downloads the source
+code, all third-party dependencies, and the toolchain needed to build things;
+and at their appropriate revisions.
## Syncing your local checkout
To update your local checkout from the openscreen master repository, just run
```bash
+ cd ~/my_project_dir/openscreen
git pull
gclient sync
```
@@ -51,24 +57,23 @@ dependencies that have changed.
# Build setup
-## Installing build dependencies
-
-The following tools are required for building:
+The following are the main tools are required for development/builds:
- Build file generator: `gn`
- - Code formatter (optional): `clang-format`
+ - Code formatter: `clang-format`
- Builder: `ninja` ([GitHub releases](https://github.com/ninja-build/ninja/releases))
+ - Compiler/Linker: `clang` (installed by default) or `gcc` (installed by you)
-`clang-format` and `ninja` can be downloaded to `buildtools/<platform>` root by
-running `./tools/install-build-tools.sh`.
-
-`clang-format` is only used for presubmit checks and optionally used on
-generated code from the CDDL tool.
+All of these--except `gcc` as noted above--are automatically downloaded/updated
+for the Linux and Mac environments via `gclient sync` as described above. The
+first two are installed into `buildtools/<platform>/`.
-`gn` will be installed in `buildtools/<platform>/` automatically by `gclient sync`.
+Mac only: XCode must be installed on the system, to link against its frameworks.
-You also need to ensure that you have the compiler and its toolchain dependencies.
-Currently, both Linux and Mac OS X build configurations use clang by default.
+`clang-format` is used for maintaining consistent coding style, but it is not a
+complete replacement for adhering to Chromium/Google C++ style (that's on you!).
+The presubmit script will sanity-check that it has been run on all new/changed
+code.
## Linux clang
@@ -153,6 +158,11 @@ the working directory for the build. So the same could be done as follows:
After editing a file, only `ninja` needs to be rerun, not `gn`. If you have
edited a `BUILD.gn` file, `ninja` will re-run `gn` for you.
+Unless you like to wait longer than necessary for builds to complete, run
+`autoninja` instead of `ninja`, which takes the same command-line arguments.
+This will automatically parallelize the build for your system, depending on
+number of processor cores, RAM, etc.
+
For details on running `demo`, see its [README.md](demo/README.md).
## Building other targets
@@ -214,11 +224,13 @@ review tool) and is recommended for pushing patches for review. Once you have
committed changes locally, simply run:
```bash
+ git cl format
git cl upload
```
-This will run our `PRESUBMIT.sh` script to check style, and if it passes, a new
-code review will be posted on `chromium-review.googlesource.com`.
+The first command will will auto-format the code changes. Then, the second
+command runs the `PRESUBMIT.sh` script to check style and, if it passes, a
+newcode review will be posted on `chromium-review.googlesource.com`.
If you make additional commits to your local branch, then running `git cl
upload` again in the same branch will merge those commits into the ongoing