Skip to content

Commit

Permalink
Add support of chip_detail_logging and chip_mdns (#7061)
Browse files Browse the repository at this point in the history
  • Loading branch information
PSONALl authored and pull[bot] committed Jun 2, 2021
1 parent 69e2bb4 commit cacbe15
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion scripts/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,56 @@ CHIP_ROOT=$(_normpath "$(dirname "$0")/..")
OUTPUT_ROOT="$CHIP_ROOT/out/python_lib"
ENVIRONMENT_ROOT="$CHIP_ROOT/out/python_env"

declare chip_detail_logging=false
declare chip_mdns="minimal"

help() {

echo "Usage: $file_name [ options ... ] [ -chip_detail_logging ChipDetailLoggingValue ] [ -chip_mdns ChipMDNSValue ]"

echo "General Options:
-h, --help Display this information.
Input Options:
-d, --chip_detail_logging ChipDetailLoggingValue Specify ChipDetailLoggingValue as true or false.
By default it is false.
-m, --chip_mdns ChipMDNSValue Specify ChipMDNSValue as platform or minimal.
By default it is minimal.
"
}

file_name=${0##*/}

while (($#)); do
case $1 in
--help | -h)
help
exit 1
;;
--chip_detail_logging | -d)
chip_detail_logging=$2
shift
;;
--chip_mdns | -m)
chip_mdns=$2
shift
;;
-*)
help
echo "Unknown Option \"$1\""
exit 1
;;
esac
shift
done

# Print input values
echo "Input values: chip_detail_logging = $chip_detail_logging , chip_mdns = \"$chip_mdns\""

# Ensure we have a compilation environment
source "$CHIP_ROOT/scripts/activate.sh"

# Generates ninja files
gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=false"
gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_detail_logging chip_mdns=\"$chip_mdns\""

# Compiles python files
ninja -C "$OUTPUT_ROOT" python
Expand Down

0 comments on commit cacbe15

Please sign in to comment.