Skip to content

Commit

Permalink
[gn] Vscode integration. Fixes #1526.
Browse files Browse the repository at this point in the history
  • Loading branch information
turon committed Jul 9, 2020
1 parent dd62545 commit 3437815
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
},
"problemMatcher": ["$gcc"]
},
{
"label": "GN Build",
"type": "shell",
"command": "./gn_build.sh",
"group": {
"kind": "build",
"isDefault": true
},
"isBackground": false,
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": ["$gcc"]
},
{
"label": "Auto-enforce coding style",
"type": "shell",
Expand Down
35 changes: 19 additions & 16 deletions gn_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,7 @@ set +e
source "$CHIP_ROOT/scripts/activate.sh"
set -e

_chip_banner "Build: GN configure"

nrf5_sdk_args=""
extra_args=""

if [[ -d "$NRF5_SDK_ROOT/components/libraries" ]]; then
nrf5_sdk_args+="nrf5_sdk_root=\"$NRF5_SDK_ROOT\""
extra_args+=" $nrf5_sdk_args enable_nrf5_lock_app_build=true"
fi

gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/debug" --args='target_os="all"'"$extra_args"
gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/release" --args='target_os="all" is_debug=false'"$extra_args"

_chip_banner "Build: Ninja build"

time ninja -C "$CHIP_ROOT/out/debug" check
_chip_banner "Instructions"

echo
echo 'To activate existing build environment in your shell, run (do this first):'
Expand Down Expand Up @@ -90,3 +75,21 @@ else
echo 'To build the nRF5 lock sample as a standalone project':
echo "(cd $CHIP_ROOT/examples/lock-app/nrf5; gn gen out/debug --args='$nrf5_sdk_args'; ninja -C out/debug)"
fi
echo

_chip_banner "Build: GN configure"

nrf5_sdk_args=""
extra_args=""

if [[ -d "$NRF5_SDK_ROOT/components/libraries" ]]; then
nrf5_sdk_args+="nrf5_sdk_root=\"$NRF5_SDK_ROOT\""
extra_args+=" $nrf5_sdk_args enable_nrf5_lock_app_build=true"
fi

gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/debug" --args='target_os="all"'"$extra_args"
gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/release" --args='target_os="all" is_debug=false'"$extra_args"

_chip_banner "Build: Ninja build"

time ninja -C "$CHIP_ROOT/out/debug" check

0 comments on commit 3437815

Please sign in to comment.