Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / scripts / examples / gn_efr32_example.sh
1 #!/usr/bin/env bash
2
3 #
4 #    Copyright (c) 2020 Project CHIP Authors
5 #
6 #    Licensed under the Apache License, Version 2.0 (the "License");
7 #    you may not use this file except in compliance with the License.
8 #    You may obtain a copy of the License at
9 #
10 #        http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #    Unless required by applicable law or agreed to in writing, software
13 #    distributed under the License is distributed on an "AS IS" BASIS,
14 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #    See the License for the specific language governing permissions and
16 #    limitations under the License.
17 #
18
19 set -e
20
21 # Build script for GN EFT32 examples GitHub workflow.
22
23 source "$(dirname "$0")/../../scripts/activate.sh"
24
25 set -x
26 env
27
28 if [ -z "$3" ]; then
29     gn gen --check --fail-on-unused-args --root="$1" --args="" "$2"/"$EFR32_BOARD"/
30     ninja -v -C "$2"/"$EFR32_BOARD"/
31     #print stats
32     arm-none-eabi-size -A "$2"/"$EFR32_BOARD"/*.out
33 else
34     gn gen --check --fail-on-unused-args --root="$1" --args="efr32_board=\"$3\"" "$2/$3"
35     ninja -v -C "$2/$3"
36     #print stats
37     arm-none-eabi-size -A "$2"/"$3"/*.out
38 fi