diff --git a/BUILD.gn b/BUILD.gn index 874ca22f232c532443859f2f2c9e993fcaea9e4b..9b414f00a3ea3db3b26927b2538f202812bb701d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -13,18 +13,6 @@ import("//build/ohos.gni") -declare_args() { - neural_network_runtime_coverage = false -} - -config("coverage_flags") { - if (neural_network_runtime_coverage) { - cflags = [ "--coverage" ] - cflags_cc = [ "--coverage" ] - ldflags = [ "--coverage" ] - } -} - group("nnrt_target") { deps = [ "frameworks/native/neural_network_core:libneural_network_core", diff --git a/config/BUILD.gn b/config/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..fb1c4af77f31799396c58d5d53a8d0d2ac3d04f4 --- /dev/null +++ b/config/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare_args() { + neural_network_runtime_coverage = false +} + +config("coverage_flags") { + if (neural_network_runtime_coverage) { + cflags = [ "--coverage" ] + cflags_cc = [ "--coverage" ] + ldflags = [ "--coverage" ] + } +} diff --git a/frameworks/native/neural_network_core/BUILD.gn b/frameworks/native/neural_network_core/BUILD.gn index c8390e23202b988ed30430829f7cb9e78836c0e4..73e52d2438e3b3c94d8f24d76e74097d580b3a43 100644 --- a/frameworks/native/neural_network_core/BUILD.gn +++ b/frameworks/native/neural_network_core/BUILD.gn @@ -45,7 +45,7 @@ ohos_shared_library("libneural_network_core") { include_dirs = [ "../../.." ] public_configs = [ - "../../..:coverage_flags", + "../../../config:coverage_flags", ":nnrt_config", ] diff --git a/frameworks/native/neural_network_runtime/BUILD.gn b/frameworks/native/neural_network_runtime/BUILD.gn index b59b9f1350fbd148c81b85eb73119f73c2d815bb..cf98d69dba11c791d6e4df01718bcc13a877aeed 100644 --- a/frameworks/native/neural_network_runtime/BUILD.gn +++ b/frameworks/native/neural_network_runtime/BUILD.gn @@ -176,7 +176,7 @@ ohos_shared_library("libneural_network_runtime") { include_dirs = [ "../../.." ] public_configs = [ - "../../..:coverage_flags", + "../../../config:coverage_flags", ":nnrt_config", ] diff --git a/test/unittest/ops/BUILD.gn b/test/unittest/ops/BUILD.gn index 8a9dab0770d53b3a64a7c155635a019a5f8ade5a..cc7b775817389213a669414d3f6ef3b633592533 100644 --- a/test/unittest/ops/BUILD.gn +++ b/test/unittest/ops/BUILD.gn @@ -150,7 +150,7 @@ ohos_unittest("OpsUnittest") { sources += [ "../common/base_test.cpp" ] configs = [ - "../../..:coverage_flags", + "../../../config:coverage_flags", ":module_private_config", ]