Skip to content

Commit

Permalink
Cherry pick PR #3057: Fix shared library install target dependency (#…
Browse files Browse the repository at this point in the history
…3087)

Refer to the original PR: #3057

b/335757361

Currently we need to run 
`ninja -C out/raspi-2_debug cobalt ; ninja -C out/raspi-2_debug
cobalt_install`
to build an installable target.

This change fixes the install target build dependency so that
`cobalt_install` depends on `cobalt` for modular installable targets
so that we just need to run `ninja -C out/raspi-2_debug cobalt_install`
to get an installable binary.

Co-authored-by: Niranjan Yardi <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and niranjanyardi committed May 15, 2024
1 parent ecdcfdb commit c890687
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cobalt/site/docs/development/setup-raspi.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@ Raspberry Pi.
following command:

```
$ cobalt/build/gn.py -p raspi-2
$ cobalt/build/gn.py -p raspi-2 -C devel
```

1. Compile the code from the `cobalt/` directory:

```
$ ninja -C out/raspi-2_debug cobalt
$ ninja -C out/raspi-2_devel cobalt_install
```

1. Run the following command to install your Cobalt binary (and content)
on the device:

```
$ rsync -avzLPh --exclude="obj*" --exclude="gen/" \
$COBALT_SRC/out/raspi-2_debug pi@$RASPI_ADDR:~/
$COBALT_SRC/out/raspi-2_devel pi@$RASPI_ADDR:~/
```

The `rsyncs` get somewhat faster after the first time, as `rsync` is good at
Expand All @@ -112,8 +112,8 @@ Raspberry Pi.

```
$ ssh pi@$RASPI_ADDR
$ cd raspi-2_debug
$ ./cobalt
$ cd raspi-2_devel/install/cobalt_loader
$ ./cobalt_loader
```

With this approach, you can just hit `[CTRL-C]` to close Cobalt. If you
Expand Down
5 changes: 4 additions & 1 deletion starboard/build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,10 @@ template("shared_library") {
not_needed([ "installable_target_dep" ])
type = "shared_library"

deps = []
# When we build "{target_name}_install", we expect all files
# needed for a working target to be present.
deps = [ ":${actual_target_name}" ]

if (defined(invoker.deps)) {
deps += invoker.deps
}
Expand Down

0 comments on commit c890687

Please sign in to comment.