From 05c84f13818133ba3a83f6eaeb4c25722c67bc45 Mon Sep 17 00:00:00 2001 From: wang-yangsong Date: Mon, 13 May 2024 14:05:00 +0800 Subject: [PATCH 1/4] bugfix Signed-off-by: wang-yangsong --- BUILD.gn | 12 ---------- config/build/BUILD.gn | 24 +++++++++++++++++++ .../native/neural_network_core/BUILD.gn | 2 +- .../native/neural_network_runtime/BUILD.gn | 2 +- test/unittest/ops/BUILD.gn | 2 +- 5 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 config/build/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn index 874ca22..9b414f0 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/BUILD.gn b/config/build/BUILD.gn new file mode 100644 index 0000000..75e4eaa --- /dev/null +++ b/config/build/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" ] + } +} \ No newline at end of file diff --git a/frameworks/native/neural_network_core/BUILD.gn b/frameworks/native/neural_network_core/BUILD.gn index c8390e2..b77f891 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/build:coverage_flags", ":nnrt_config", ] diff --git a/frameworks/native/neural_network_runtime/BUILD.gn b/frameworks/native/neural_network_runtime/BUILD.gn index b59b9f1..fb6270f 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/build:coverage_flags", ":nnrt_config", ] diff --git a/test/unittest/ops/BUILD.gn b/test/unittest/ops/BUILD.gn index 8a9dab0..a1d6217 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/build:coverage_flags", ":module_private_config", ] -- Gitee From 3811b8ae44cdf3dda8db19f7f7f63df62dcab508 Mon Sep 17 00:00:00 2001 From: wang-yangsong Date: Mon, 13 May 2024 15:23:13 +0800 Subject: [PATCH 2/4] fix gn format Signed-off-by: wang-yangsong --- config/build/BUILD.gn | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/config/build/BUILD.gn b/config/build/BUILD.gn index 75e4eaa..fb1c4af 100644 --- a/config/build/BUILD.gn +++ b/config/build/BUILD.gn @@ -1,24 +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 +# 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" ] - } -} \ No newline at end of file + +declare_args() { + neural_network_runtime_coverage = false +} + +config("coverage_flags") { + if (neural_network_runtime_coverage) { + cflags = [ "--coverage" ] + cflags_cc = [ "--coverage" ] + ldflags = [ "--coverage" ] + } +} -- Gitee From f2c56c85beacdf0d1ac55556f8ba648ae41da374 Mon Sep 17 00:00:00 2001 From: wang-yangsong Date: Mon, 13 May 2024 18:59:18 +0800 Subject: [PATCH 3/4] modify path Signed-off-by: wang-yangsong --- config/{build => }/BUILD.gn | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config/{build => }/BUILD.gn (100%) diff --git a/config/build/BUILD.gn b/config/BUILD.gn similarity index 100% rename from config/build/BUILD.gn rename to config/BUILD.gn -- Gitee From 2a989b76b37125eacba9014de8522cbdf90d5b7c Mon Sep 17 00:00:00 2001 From: wang-yangsong Date: Mon, 13 May 2024 19:57:49 +0800 Subject: [PATCH 4/4] bugfix Signed-off-by: wang-yangsong --- frameworks/native/neural_network_core/BUILD.gn | 2 +- frameworks/native/neural_network_runtime/BUILD.gn | 2 +- test/unittest/ops/BUILD.gn | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frameworks/native/neural_network_core/BUILD.gn b/frameworks/native/neural_network_core/BUILD.gn index b77f891..73e52d2 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 = [ - "../../../config/build: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 fb6270f..cf98d69 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 = [ - "../../../config/build:coverage_flags", + "../../../config:coverage_flags", ":nnrt_config", ] diff --git a/test/unittest/ops/BUILD.gn b/test/unittest/ops/BUILD.gn index a1d6217..cc7b775 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 = [ - "../../../config/build:coverage_flags", + "../../../config:coverage_flags", ":module_private_config", ] -- Gitee