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