Skip to content

Commit

Permalink
changing deprecated GN flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Alami-Amine committed Sep 5, 2024
1 parent 6ade0df commit 5aede46
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 181 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:
esac
rm -rf ./out/sanitizers
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --add-export-compile-commands="*"
BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh
done
- name: Ensure codegen is done for sanitize
Expand Down Expand Up @@ -415,7 +415,7 @@ jobs:
# clang.
"default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';;
esac
BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --add-export-compile-commands="*"
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh
done
Expand Down
2 changes: 1 addition & 1 deletion config/qpg/chip-gn/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ gn \
--root-target=//config/qpg/chip-gn \
--dotfile="$GN_ROOT_TARGET/.gn" \
--script-executable=python3 \
--export-compile-commands \
--add-export-compile-commands="*" \
gen \
--check \
--args="$GN_ARGS" \
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def main() -> int:
CHEF_FLAGS += -DCONFIG_DEVICE_PRODUCT_ID={options.pid}
CHEF_FLAGS += -DCHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"{options.pid}\"
"""
))
))
if options.do_clean:
shell.run_cmd("make clean")
shell.run_cmd("make chef")
Expand Down Expand Up @@ -884,7 +884,7 @@ def main() -> int:
"""))
if options.do_clean:
shell.run_cmd("rm -rf out")
shell.run_cmd("gn gen --export-compile-commands out")
shell.run_cmd("gn gen --add-export-compile-commands="*" out")
shell.run_cmd("ninja -C out")

#
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/tizen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Generating tizen-arm-light
```sh
gn gen --check \
--fail-on-unused-args \
--export-compile-commands \
--add-export-compile-commands="*" \
--root=$PW_PROJECT_ROOT/examples/lighting-app/tizen \
"--args=target_os=\"tizen\" target_cpu=\"arm\" tizen_sdk_root=\"$TIZEN_SDK_ROOT\" tizen_sdk_sysroot=\"$TIZEN_SDK_SYSROOT\"" \
$PW_PROJECT_ROOT/out/tizen-arm-light
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/builders/efr32.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def bundle_outputs(self):
def generate(self):
cmd = [
'gn', 'gen', '--check', '--fail-on-unused-args',
'--export-compile-commands',
'--add-export-compile-commands="*"',
'--root=%s' % self.root
]
if self.dotfile:
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/builders/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def PostBuildCommand(self):
def generate(self):
cmd = [
'gn', 'gen', '--check', '--fail-on-unused-args',
'--export-compile-commands',
'--add-export-compile-commands="*"',
'--root=%s' % self.root
]

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/builders/nxp.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def generate(self):
elif p.sdk_name == 'common':
cmd += 'export NXP_SDK_ROOT="' + str(p.sdk_storage_location_abspath) + '" \n '
# add empty space at the end to avoid concatenation issue when there is no --args
cmd += 'gn gen --check --fail-on-unused-args --export-compile-commands --root=%s ' % self.root
cmd += 'gn gen --check --fail-on-unused-args --add-export-compile-commands="*" --root=%s ' % self.root

extra_args = []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cd "{root}"

# Generating efr32-brd4187c-light-rpc-no-version
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/silabs '--args=silabs_board="BRD4187C" is_debug=false import("//with_pw_rpc.gni") efr32_sdk_root="TEST_GSDK_ROOT" openthread_root="TEST_GSDK_ROOT/util/third_party/openthread" wiseconnect_sdk_root="TEST_WISECONNECT_SDK_ROOT" wifi_sdk_root="TEST_WIFI_SDK_ROOT"' {out}/efr32-brd4187c-light-rpc-no-version
gn gen --check --fail-on-unused-args --add-export-compile-commands="*" --root={root}/examples/lighting-app/silabs '--args=silabs_board="BRD4187C" is_debug=false import("//with_pw_rpc.gni") efr32_sdk_root="TEST_GSDK_ROOT" openthread_root="TEST_GSDK_ROOT/util/third_party/openthread" wiseconnect_sdk_root="TEST_WISECONNECT_SDK_ROOT" wifi_sdk_root="TEST_WIFI_SDK_ROOT"' {out}/efr32-brd4187c-light-rpc-no-version

# Building efr32-brd4187c-light-rpc-no-version
ninja -C {out}/efr32-brd4187c-light-rpc-no-version
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cd "{root}"
# Generating linux-arm64-chip-tool-ipv6only-clang
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '"'"'--args=chip_inet_config_enable_ipv4=false is_clang=true target_cpu="arm64" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-chip-tool-ipv6only-clang'
gn gen --check --fail-on-unused-args --add-export-compile-commands="*" --root={root}/examples/chip-tool '"'"'--args=chip_inet_config_enable_ipv4=false is_clang=true target_cpu="arm64" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-chip-tool-ipv6only-clang'

# Setting up Java deps
third_party/java_deps/set_up_java_deps.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cd "{root}"
# Generating linux-arm64-ota-requestor-nodeps-ipv6only
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/ota-requestor-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true chip_crypto="mbedtls" target_cpu="arm64" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-ota-requestor-nodeps-ipv6only'
gn gen --check --fail-on-unused-args --add-export-compile-commands="*" --root={root}/examples/ota-requestor-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true chip_crypto="mbedtls" target_cpu="arm64" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-ota-requestor-nodeps-ipv6only'

# Setting up Java deps
third_party/java_deps/set_up_java_deps.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cd "{root}"

# Generating linux-x64-all-clusters-coverage
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux --args=use_coverage=true {out}/linux-x64-all-clusters-coverage
gn gen --check --fail-on-unused-args --add-export-compile-commands="*" --root={root}/examples/all-clusters-app/linux --args=use_coverage=true {out}/linux-x64-all-clusters-coverage

# Setting up Java deps
third_party/java_deps/set_up_java_deps.sh
Expand Down
2 changes: 1 addition & 1 deletion scripts/examples/gn_bouffalolab_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ else
example_dir=$MATTER_ROOT/examples/$example_name/bouffalolab/$bouffalo_chip
output_dir=$MATTER_ROOT/$output_folder

gn gen --check --fail-on-unused-args --export-compile-commands --root="$example_dir" "$output_dir" --args="${optArgs[*]}"
gn gen --check --fail-on-unused-args --add-export-compile-commands="*" --root="$example_dir" "$output_dir" --args="${optArgs[*]}"

ninja -C "$output_dir"
fi
230 changes: 115 additions & 115 deletions scripts/examples/gn_silabs_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,122 +172,122 @@ else
shift
while [ $# -gt 0 ]; do
case $1 in
--clean)
DIR_CLEAN=true
shift
;;
--wifi)
if [ -z "$2" ]; then
echo "--wifi requires rs9116 or SiWx917 or wf200"
exit 1
fi
if [ "$2" = "rs9116" ]; then
optArgs+="use_rs9116=true "
elif [ "$2" = "SiWx917" ]; then
optArgs+="use_SiWx917=true "
elif [ "$2" = "wf200" ]; then
optArgs+="use_wf200=true "
else
echo "Wifi usage: --wifi rs9116|SiWx917|wf200"
exit 1
fi
--clean)
DIR_CLEAN=true
shift
;;
--wifi)
if [ -z "$2" ]; then
echo "--wifi requires rs9116 or SiWx917 or wf200"
exit 1
fi
if [ "$2" = "rs9116" ]; then
optArgs+="use_rs9116=true "
elif [ "$2" = "SiWx917" ]; then
optArgs+="use_SiWx917=true "
elif [ "$2" = "wf200" ]; then
optArgs+="use_wf200=true "
else
echo "Wifi usage: --wifi rs9116|SiWx917|wf200"
exit 1
fi
USE_WIFI=true
optArgs+="chip_device_platform =\"efr32\" "
shift
shift
;;
--icd)
optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false sl_enable_test_event_trigger=true "
shift
;;
--low-power)
optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true "
shift
;;
--chip_enable_wifi_ipv4)
optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true "
shift
;;
--additional_data_advertising)
optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true "
shift
;;
--use_ot_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" "
shift
;;
--use_ot_coap_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true "
shift
;;
--use_chip_lwip_lib)
optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" "
shift
;;
# Option not to be used until ot-efr32 github is updated
# --use_ot_github_sources)
# optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\""
# shift
# ;;
--release)
optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false "
shift
;;
--bootloader)
USE_BOOTLOADER=true
shift
;;
--docker)
optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" "
optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" "
optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" "
USE_DOCKER=true
shift
;;
--uart_log)
optArgs+="sl_uart_log_output=true "
shift
;;

--slc_generate)
optArgs+="slc_generate=true "
USE_SLC=true
shift
;;
--use_pw_rpc)
optArgs+="import(\"//with_pw_rpc.gni\") "
shift
;;
--slc_reuse_files)
optArgs+="slc_reuse_files=true "
USE_SLC=true
shift
;;
--gn_path)
if [ -z "$2" ]; then
echo "--gn_path requires a path to GN"
exit 1
else
GN_PATH="$2"
fi
GN_PATH_PROVIDED=true
shift
shift
;;
*"sl_matter_version_str="*)
optArgs+="$1 "
USE_GIT_SHA_FOR_VERSION=false
shift
;;
*)
if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then
USE_WIFI=true
# NCP Mode so base MCU is an EFR32
optArgs+="chip_device_platform =\"efr32\" "
shift
shift
;;
--icd)
optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false sl_enable_test_event_trigger=true "
shift
;;
--low-power)
optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true "
shift
;;
--chip_enable_wifi_ipv4)
optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true "
shift
;;
--additional_data_advertising)
optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true "
shift
;;
--use_ot_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" "
shift
;;
--use_ot_coap_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true "
shift
;;
--use_chip_lwip_lib)
optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" "
shift
;;
# Option not to be used until ot-efr32 github is updated
# --use_ot_github_sources)
# optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\""
# shift
# ;;
--release)
optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false "
shift
;;
--bootloader)
USE_BOOTLOADER=true
shift
;;
--docker)
optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" "
optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" "
optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" "
USE_DOCKER=true
shift
;;
--uart_log)
optArgs+="sl_uart_log_output=true "
shift
;;

--slc_generate)
optArgs+="slc_generate=true "
USE_SLC=true
shift
;;
--use_pw_rpc)
optArgs+="import(\"//with_pw_rpc.gni\") "
shift
;;
--slc_reuse_files)
optArgs+="slc_reuse_files=true "
USE_SLC=true
shift
;;
--gn_path)
if [ -z "$2" ]; then
echo "--gn_path requires a path to GN"
exit 1
else
GN_PATH="$2"
fi
GN_PATH_PROVIDED=true
shift
shift
;;
*"sl_matter_version_str="*)
optArgs+="$1 "
USE_GIT_SHA_FOR_VERSION=false
shift
;;
*)
if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then
USE_WIFI=true
# NCP Mode so base MCU is an EFR32
optArgs+="chip_device_platform =\"efr32\" "
fi
optArgs+=$1" "
shift
;;
fi
optArgs+=$1" "
shift
;;
esac
done

Expand Down Expand Up @@ -340,7 +340,7 @@ else
optArgs+="openthread_root=\"$GSDK_ROOT/util/third_party/openthread\" "
fi

"$GN_PATH" gen --check --script-executable="$PYTHON_PATH" --fail-on-unused-args --export-compile-commands --root="$ROOT" --dotfile="$DOTFILE" --args="silabs_board=\"$SILABS_BOARD\" $optArgs" "$BUILD_DIR"
"$GN_PATH" gen --check --script-executable="$PYTHON_PATH" --fail-on-unused-args --add-export-compile-commands="*" --root="$ROOT" --dotfile="$DOTFILE" --args="silabs_board=\"$SILABS_BOARD\" $optArgs" "$BUILD_DIR"

if [ "$USE_SLC" == true ]; then
# Activation needs to be after SLC generation which is done in gn gen.
Expand Down
Loading

0 comments on commit 5aede46

Please sign in to comment.