1# Copyright (c) 2021-2024 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14# There seems to be a bug in either clang-tidy or CMake: 15# When clang/gcc is used for cross-compilation, it is ran on host and use defines and options for host 16# For example for arm32 cross-compilation Clang-Tidy: 17# - don't know about -march=armv7-a 18# - believes that size of pointer is 64 instead of 32 for aarch32 19# TODO: Retry once we upgrade the checker. 20 21 22add_custom_target(clang-tidy-static-core-check 23 COMMAND ${PANDA_ROOT}/scripts/clang-tidy/clang_tidy_check.py --filename-filter /runtime_core/static_core/ ${PANDA_ROOT} ${PANDA_BINARY_ROOT} 24 USES_TERMINAL 25 DEPENDS panda_gen_files 26) 27 28add_custom_target(clang-tidy-ets2panda-check 29 COMMAND ${PANDA_ROOT}/scripts/clang-tidy/clang_tidy_check.py --filename-filter /ets2panda/ ${PANDA_ROOT} ${PANDA_BINARY_ROOT} 30 USES_TERMINAL 31 DEPENDS panda_gen_files 32) 33 34add_custom_target(clang-tidy-check 35 COMMAND ${PANDA_ROOT}/scripts/clang-tidy/clang_tidy_check.py ${PANDA_ROOT} ${PANDA_BINARY_ROOT} 36 USES_TERMINAL 37 DEPENDS panda_gen_files 38) 39 40add_custom_target(clang-tidy-check-full 41 COMMAND ${PANDA_ROOT}/scripts/clang-tidy/clang_tidy_check.py --full ${PANDA_ROOT} ${PANDA_BINARY_ROOT} 42 USES_TERMINAL 43 DEPENDS panda_gen_files 44) 45 46add_custom_target(cmake-checker 47 COMMAND ${PANDA_ROOT}/scripts/cmake-checker/cmake_checker.py ${PANDA_ROOT} 48 USES_TERMINAL 49) 50 51add_custom_target(test-cmake-checker 52 COMMAND ${PANDA_ROOT}/scripts/cmake-checker/cmake_checker.py ${PANDA_ROOT} TEST 53 USES_TERMINAL 54) 55