• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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
14import("//build/ohos.gni")
15import("//build/test.gni")
16import("./restool.gni")
17
18ohos_executable("restool") {
19  sources = [
20    "src/append_compiler.cpp",
21    "src/cmd_parser.cpp",
22    "src/compression_parser.cpp",
23    "src/config_parser.cpp",
24    "src/factory_resource_compiler.cpp",
25    "src/file_entry.cpp",
26    "src/file_manager.cpp",
27    "src/generic_compiler.cpp",
28    "src/header.cpp",
29    "src/i_resource_compiler.cpp",
30    "src/id_defined_parser.cpp",
31    "src/id_worker.cpp",
32    "src/json_compiler.cpp",
33    "src/key_parser.cpp",
34    "src/reference_parser.cpp",
35    "src/resconfig_parser.cpp",
36    "src/resource_append.cpp",
37    "src/resource_check.cpp",
38    "src/resource_directory.cpp",
39    "src/resource_item.cpp",
40    "src/resource_merge.cpp",
41    "src/resource_module.cpp",
42    "src/resource_pack.cpp",
43    "src/resource_table.cpp",
44    "src/resource_util.cpp",
45    "src/restool.cpp",
46    "src/select_compile_parse.cpp",
47    "src/task_handle.cpp",
48    "src/translatable_parser.cpp",
49  ]
50
51  include_dirs = [
52    "include",
53    "//third_party/bounds_checking_function/include",
54  ]
55
56  deps = [
57    "//third_party/bounds_checking_function:libsec_static",
58    "//third_party/cJSON:cjson_static",
59    "//third_party/libpng:libpng_static",
60  ]
61
62  cflags = [ "-std=c++17" ]
63  if (is_mingw) {
64    ldflags = [
65      "-static",
66      "-lws2_32",
67      "-lshlwapi",
68    ]
69  }
70  subsystem_name = "developtools"
71  part_name = "global_resource_tool"
72}
73
74ohos_unittest_py("restool_test") {
75  sources = [ "test/test.py" ]
76}
77
78ohos_copy("restool_id_defined") {
79  sources = [ "${id_defined_path}" ]
80  outputs = [ get_label_info(":restool($host_toolchain)", "root_out_dir") +
81              "/developtools/global_resource_tool/{{source_file_part}}" ]
82  deps = [ ":restool($host_toolchain)" ]
83  subsystem_name = "developtools"
84  part_name = "global_resource_tool"
85}
86
87ohos_prebuilt_etc("restool_systemres") {
88  source = "${id_defined_path}"
89  subsystem_name = "developtools"
90  part_name = "global_resource_tool"
91}
92