Skip to content

Commit

Permalink
[gn] Vscode integration. Fixes project-chip#1526. (project-chip#1527)
Browse files Browse the repository at this point in the history
* [gn] Vscode integration. Fixes project-chip#1526.

* [gn] Fix merge conflict.
  • Loading branch information
turon authored and kedars committed Jul 21, 2020
1 parent cbadd60 commit ff69591
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 @@ -40,22 +40,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_builds=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" all check
_chip_banner "Instructions"

echo
echo 'To activate existing build environment in your shell, run (do this first):'
Expand Down Expand Up @@ -91,3 +76,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_builds=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" all check

0 comments on commit ff69591

Please sign in to comment.