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# option(ENABLE_COMPILER_COVERAGE "Enable coverage-calculation for compiler" false) 15 16# CC-OFFNXT(bc-40028) false positive 17include(${PANDA_ROOT}/cmake/toolchain/coverage/unit_tests_lcov.cmake) 18 19if(ENABLE_COMPILER_COVERAGE) 20 add_custom_target(compiler_coverage DEPENDS cts-assembly tests benchmarks) 21 collect_coverage_for_target( 22 TARGET_NAME compiler_coverage 23 INCLUDE_DIR_PATTERN \"*/compiler/*\" 24 EXCLUDE_DIR_PATTERN \"/usr*\" \"*/third_party/*\" \"*/build/*\" \"*/plugins/*\" \"*/runtime/*\" \"*/bytecode_optimizer/*\" \"*/libpandabase/*\" 25 ) 26else() 27 message(STATUS "Coverage will not be calculated (may be enabled by -DENABLE_COMPILER_COVERAGE=true ).") 28endif(ENABLE_COMPILER_COVERAGE) 29