From b2d23bbb85b7afabcc2bfa38834507986e4f4f35 Mon Sep 17 00:00:00 2001 From: Niranjan Yardi Date: Thu, 25 Apr 2024 13:26:49 -0700 Subject: [PATCH] Fix shared library install target dependency (#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. (cherry picked from commit 25df9d74debcf0b4376726ad2f5e83183b1ed5b6) --- cobalt/site/docs/development/setup-raspi.md | 10 +++++----- starboard/build/config/BUILDCONFIG.gn | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cobalt/site/docs/development/setup-raspi.md b/cobalt/site/docs/development/setup-raspi.md index 8a3acdc03a45..3a9873cedc8a 100644 --- a/cobalt/site/docs/development/setup-raspi.md +++ b/cobalt/site/docs/development/setup-raspi.md @@ -86,13 +86,13 @@ 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) @@ -100,7 +100,7 @@ Raspberry Pi. ``` $ 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 @@ -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 diff --git a/starboard/build/config/BUILDCONFIG.gn b/starboard/build/config/BUILDCONFIG.gn index 7f809bcc720c..27193183452b 100644 --- a/starboard/build/config/BUILDCONFIG.gn +++ b/starboard/build/config/BUILDCONFIG.gn @@ -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 }