You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

option_proc_debug.sh 2.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. # Copyright 2021 Huawei Technologies Co., Ltd
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # ============================================================================
  16. set -e
  17. build_option_proc_v()
  18. {
  19. export ENABLE_VERBOSE="on"
  20. export VERBOSE="VERBOSE=1"
  21. }
  22. build_option_proc_c()
  23. {
  24. check_on_off $OPTARG c
  25. export ENABLE_COVERAGE="$OPTARG"
  26. }
  27. build_option_proc_t()
  28. {
  29. if [[ "X$OPTARG" == "Xon" || "X$OPTARG" == "Xut" ]]; then
  30. export RUN_TESTCASES="on"
  31. elif [[ "X$OPTARG" == "Xoff" ]]; then
  32. export RUN_TESTCASES="off"
  33. elif [[ "X$OPTARG" == "Xst" ]]; then
  34. export RUN_CPP_ST_TESTS="on"
  35. else
  36. echo "Invalid value ${OPTARG} for option -t"
  37. usage
  38. exit 1
  39. fi
  40. }
  41. build_option_proc_g()
  42. {
  43. check_on_off $OPTARG g
  44. export USE_GLOG="$OPTARG"
  45. }
  46. build_option_proc_h()
  47. {
  48. usage
  49. exit 0
  50. }
  51. build_option_proc_a()
  52. {
  53. check_on_off $OPTARG a
  54. export ENABLE_ASAN="$OPTARG"
  55. }
  56. build_option_proc_p()
  57. {
  58. check_on_off $OPTARG p
  59. export ENABLE_PROFILE="$OPTARG"
  60. }
  61. build_option_proc_upper_d()
  62. {
  63. check_on_off $OPTARG D
  64. if [[ "X$OPTARG" == "Xon" ]]; then
  65. if [[ "X$ENABLE_SECURITY" == "Xon" ]]; then
  66. echo "enable security, the dump ir is not available"
  67. usage
  68. exit 1
  69. fi
  70. export USER_ENABLE_DUMP_IR=true
  71. fi
  72. export ENABLE_DUMP_IR="$OPTARG"
  73. echo "enable dump function graph ir"
  74. }
  75. build_option_proc_upper_b()
  76. {
  77. check_on_off $OPTARG B
  78. if [[ "X$OPTARG" == "Xon" ]]; then
  79. if [[ "X$ENABLE_SECURITY" == "Xon" ]]; then
  80. echo "enable security, the debugger is not available"
  81. usage
  82. exit 1
  83. fi
  84. export USER_ENABLE_DEBUGGER=true
  85. fi
  86. export ENABLE_DEBUGGER="$OPTARG"
  87. }