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") 15 16config("idl_config") { 17 include_dirs = [ "./" ] 18} 19 20common_sources = [ 21 "ast/ast_array_type.cpp", 22 "ast/ast_boolean_type.cpp", 23 "ast/ast_byte_type.cpp", 24 "ast/ast_char_type.cpp", 25 "ast/ast_double_type.cpp", 26 "ast/ast_float_type.cpp", 27 "ast/ast_integer_type.cpp", 28 "ast/ast_interface_type.cpp", 29 "ast/ast_list_type.cpp", 30 "ast/ast_long_type.cpp", 31 "ast/ast_map_type.cpp", 32 "ast/ast_method.cpp", 33 "ast/ast_module.cpp", 34 "ast/ast_namespace.cpp", 35 "ast/ast_node.cpp", 36 "ast/ast_parameter.cpp", 37 "ast/ast_sequenceable_type.cpp", 38 "ast/ast_short_type.cpp", 39 "ast/ast_string_type.cpp", 40 "ast/ast_type.cpp", 41 "ast/ast_void_type.cpp", 42] 43 44common_sources += [ 45 "codegen/code_emitter.cpp", 46 "codegen/code_generator.cpp", 47 "codegen/cpp_code_emitter.cpp", 48 "codegen/rust_code_emitter.cpp", 49 "codegen/ts_code_emitter.cpp", 50] 51 52common_sources += [ 53 "metadata/metadata_builder.cpp", 54 "metadata/metadata_dumper.cpp", 55 "metadata/metadata_reader.cpp", 56 "metadata/metadata_serializer.cpp", 57] 58 59common_sources += [ 60 "parser/lexer.cpp", 61 "parser/parser.cpp", 62] 63 64common_sources += [ 65 "util/file.cpp", 66 "util/light_refcount_base.cpp", 67 "util/logger.cpp", 68 "util/options.cpp", 69 "util/string.cpp", 70 "util/string_builder.cpp", 71 "util/string_pool.cpp", 72] 73 74ohos_executable("idl") { 75 sources = [ "main.cpp" ] 76 sources += common_sources 77 78 configs = [ ":idl_config" ] 79 80 external_deps = [ "bounds_checking_function:libsec_static" ] 81 82 install_enable = false 83 part_name = "idl_tool" 84 subsystem_name = "ability" 85} 86