webos_example.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright (c) 2022 Project CHIP Authors
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. # Activating connectedhomeip build environment
  18. source scripts/activate.sh
  19. # Clone webos_sdk
  20. echo "##### Cloning webOS OSE SDK #####"
  21. git clone https://github.com/cabin15/webos-ose-ndk third_party/webos_sdk
  22. # Extract webOS SDK
  23. cat third_party/webos_sdk/v2.14.1/webos_sdk.tar* | (
  24. cd third_party/webos_sdk/v2.14.1/
  25. tar xvzf -
  26. )
  27. # Grant execute permission for NDK install script
  28. chmod 555 third_party/webos_sdk/v2.14.1/webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.sh
  29. # Install webOS OSE NDK
  30. echo "##### Install webOS OSE NDK #####"
  31. third_party/webos_sdk/v2.14.1/webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.sh -d third_party/webos_sdk/v2.14.1 -y
  32. # Activating webOS NDK build environment
  33. echo "##### Activating webOS NDK build environment #####"
  34. source third_party/webos_sdk/v2.14.1/environment-setup-cortexa7t2hf-neon-vfpv4-webos-linux-gnueabi
  35. echo ""
  36. # Build webos example
  37. echo "##### Build webos example #####"
  38. echo "##### Performing gn gen #####"
  39. gn gen out/host --args="is_debug=false target_os=\"webos\" target_cpu=\"arm\" chip_enable_python_modules=false ar_webos=\"$AR\" cc_webos=\"$CC -Wno-format-security\" cxx_webos=\"$CXX\" webos_sysroot=\"$PKG_CONFIG_SYSROOT_DIR\" chip_build_tests=false enable_syslog=true treat_warnings_as_errors=false"
  40. echo "##### Building by ninja #####"
  41. ninja -C out/host