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