1be168c0dSopenharmony_ci# Copyright 2022 Huawei Technologies Co., Ltd
2be168c0dSopenharmony_ci#
3be168c0dSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
4be168c0dSopenharmony_ci# you may not use this file except in compliance with the License.
5be168c0dSopenharmony_ci# You may obtain a copy of the License at
6be168c0dSopenharmony_ci#
7be168c0dSopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0
8be168c0dSopenharmony_ci#
9be168c0dSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
10be168c0dSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
11be168c0dSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12be168c0dSopenharmony_ci# See the License for the specific language governing permissions and
13be168c0dSopenharmony_ci# limitations under the License.
14be168c0dSopenharmony_ci# ============================================================================
15be168c0dSopenharmony_ci
16be168c0dSopenharmony_ciimport("//build/ohos.gni")
17be168c0dSopenharmony_ci
18be168c0dSopenharmony_ci# Prepare source at first.
19be168c0dSopenharmony_ciin_zip_path = rebase_path("./mindspore-v2.1.0.zip", root_build_dir)
20be168c0dSopenharmony_ciout_src_path = rebase_path("./mindspore-src", root_build_dir)
21be168c0dSopenharmony_cipatch_dir = rebase_path("./patches/", root_build_dir)
22be168c0dSopenharmony_ci
23be168c0dSopenharmony_ciargs = []
24be168c0dSopenharmony_ciargs += [
25be168c0dSopenharmony_ci  "--in_zip_path",
26be168c0dSopenharmony_ci  in_zip_path,
27be168c0dSopenharmony_ci]
28be168c0dSopenharmony_ciargs += [
29be168c0dSopenharmony_ci  "--out_src_path",
30be168c0dSopenharmony_ci  out_src_path,
31be168c0dSopenharmony_ci]
32be168c0dSopenharmony_ciargs += [
33be168c0dSopenharmony_ci  "--patch_dir",
34be168c0dSopenharmony_ci  patch_dir,
35be168c0dSopenharmony_ci]
36be168c0dSopenharmony_ciprint(args)
37be168c0dSopenharmony_ci
38be168c0dSopenharmony_ciexec_script("build_helper.py", args)
39be168c0dSopenharmony_ciprint("Done prepare mindspore source.")
40be168c0dSopenharmony_ci
41be168c0dSopenharmony_ci# Define targets
42be168c0dSopenharmony_ciohos_group("mindspore-all") {
43be168c0dSopenharmony_ci  deps = [ "mindspore-src/source/mindspore/lite/:mindspore" ]
44be168c0dSopenharmony_ci}
45be168c0dSopenharmony_ci
46be168c0dSopenharmony_cigroup("mindir") {
47be168c0dSopenharmony_ci  public_deps = [ "mindspore-src/source/mindspore/lite/mindir:mindir_lib" ]
48be168c0dSopenharmony_ci}
49be168c0dSopenharmony_ci
50be168c0dSopenharmony_ciohos_group("mindspore-ndk") {
51be168c0dSopenharmony_ci  deps = [ "mindspore-src/source/mindspore/lite/:mindspore_ndk" ]
52be168c0dSopenharmony_ci}
53be168c0dSopenharmony_ci
54be168c0dSopenharmony_ciohos_group("mindspore-lib") {
55be168c0dSopenharmony_ci  deps = [ "mindspore-src/source/mindspore/lite/:mindspore_lib" ]
56be168c0dSopenharmony_ci}
57be168c0dSopenharmony_ci
58be168c0dSopenharmony_cigroup("mindspore-test") {
59be168c0dSopenharmony_ci  testonly = true
60be168c0dSopenharmony_ci  deps = [
61be168c0dSopenharmony_ci    "test:mindspore_fuzz_test",
62be168c0dSopenharmony_ci    "test:mindspore_system_test",
63be168c0dSopenharmony_ci    "test:mindspore_unit_test",
64be168c0dSopenharmony_ci  ]
65be168c0dSopenharmony_ci}
66