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/task_handle.cpp", 45 ] 46 47 include_dirs = [ 48 "include", 49 "//third_party/jsoncpp/include", 50 "//third_party/bounds_checking_function/include", 51 ] 52 53 deps = [ 54 "//third_party/bounds_checking_function:libsec_static", 55 "//third_party/jsoncpp:jsoncpp_static", 56 "//third_party/libpng:libpng_static", 57 ] 58 59 cflags = [ "-std=c++17" ] 60 if (is_mingw) { 61 ldflags = [ 62 "-static", 63 "-lws2_32", 64 "-lshlwapi", 65 ] 66 } 67 subsystem_name = "developtools" 68 part_name = "global_resource_tool" 69} 70 71ohos_unittest_py("restool_test") { 72 sources = [ "test/test.py" ] 73} 74 75ohos_copy("restool_id_defined") { 76 sources = [ "${id_defined_path}" ] 77 outputs = [ get_label_info(":restool($host_toolchain)", "root_out_dir") + 78 "/developtools/global_resource_tool/" ] 79 deps = [ ":restool($host_toolchain)" ] 80 subsystem_name = "developtools" 81 part_name = "global_resource_tool" 82} 83 84ohos_prebuilt_etc("restool_systemres") { 85 source = "${id_defined_path}" 86 subsystem_name = "developtools" 87 part_name = "global_resource_tool" 88} 89