# Copyright (c) Huawei Device Co., Ltd. 2026-2026. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build/ohos.gni")

import("//foundation/officeservice/object_editor/object_editor.gni")

# Build content_embed_document.so
ohos_shared_library("content_embed_document") {
    branch_protector_ret = "pac_ret"
    sanitize = {
        cfi = true
        cfi_cross_dso = true
        debug = false
    }

    output_name = "content_embed_document"
    output_extension = "so"

    include_dirs = [
        "include",
        "${object_editor_path}/utils/include/dfx",
        "${object_editor_path}/interfaces/innerkits/include",
        "${object_editor_path}/common/include"
    ]

    configs = [
        "${object_editor_path}/resources/config/build:coverage_flags",
    ]

    sources = [
        "src/object_editor_document.cpp",
        "src/pole.cpp",
        "src/alloctable.cpp",
        "src/dirtree.cpp",
        "src/header.cpp",
        "src/storage.cpp",
        "src/stream.cpp",
        "src/utils.cpp",
        "${object_editor_path}/common/src/system_utils.cpp",
    ]

    external_deps = [
        "c_utils:utils",
        "ipc:ipc_core",
        "ability_base:zuri",
        "ability_base:configuration",
        "ability_base:session_info",
        "ability_runtime:app_context",
        "app_file_service:fileuri_native",
        "bundle_framework:appexecfwk_core",
        "bundle_framework:appexecfwk_base",
        "hilog:libhilog",
        "icu:shared_icuuc",
        "init:libbegetutil",
    ]

    part_name = "object_editor"
    subsystem_name = "officeservice"
}