• 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")
16ohos_executable("restool") {
17  sources = [
18    "src/cmd_list.cpp",
19    "src/cmd_parser.cpp",
20    "src/config_parser.cpp",
21    "src/factory_resource_compiler.cpp",
22    "src/file_entry.cpp",
23    "src/file_manager.cpp",
24    "src/generic_compiler.cpp",
25    "src/header.cpp",
26    "src/i_resource_compiler.cpp",
27    "src/id_worker.cpp",
28    "src/increment_index.cpp",
29    "src/increment_list.cpp",
30    "src/increment_manager.cpp",
31    "src/json_compiler.cpp",
32    "src/key_parser.cpp",
33    "src/module_combine.cpp",
34    "src/preview_manager.cpp",
35    "src/reference_parser.cpp",
36    "src/resource_directory.cpp",
37    "src/resource_item.cpp",
38    "src/resource_merge.cpp",
39    "src/resource_module.cpp",
40    "src/resource_module_inc.cpp",
41    "src/resource_pack.cpp",
42    "src/resource_table.cpp",
43    "src/resource_util.cpp",
44    "src/restool.cpp",
45    "src/solid_xml_compiler.cpp",
46    "src/sqlite_database.cpp",
47    "src/task_handle.cpp",
48    "src/xml/key_manager.cpp",
49    "src/xml/solid_xml.cpp",
50    "src/xml/xml_converter.cpp",
51    "src/xml/xml_key_node.cpp",
52  ]
53
54  include_dirs = []
55  if (is_mingw) {
56    include_dirs +=
57        [ "//developtools/global_resource_tool/build/libxml2/win32/include" ]
58  }
59  include_dirs += [
60    "include",
61    "//third_party/libxml2/include",
62    "//third_party/jsoncpp/include",
63    "//third_party/sqlite/include",
64    "//third_party/bounds_checking_function/include",
65  ]
66
67  deps = [
68    "//developtools/global_resource_tool/build/bounds_checking_function:restool_bounds_checking_function",
69    "//developtools/global_resource_tool/build/jsoncpp:restool_jsoncpp",
70    "//developtools/global_resource_tool/build/libxml2:restool_libxml2",
71    "//developtools/global_resource_tool/build/sqlite3:restool_sqlite",
72  ]
73
74  cflags = [ "-std=c++17" ]
75  if (is_mingw) {
76    ldflags = [
77      "-static",
78      "-lws2_32",
79    ]
80  }
81  subsystem_name = "developtools"
82  part_name = "global_restool"
83}
84
85ohos_unittest_py("restool_test") {
86  sources = [ "test/test.py" ]
87}
88