# Copyright (c) 2021 Huawei Device Co., Ltd. # 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/distributeddatamgr/preferences/preferences.gni") config("native_preferences_config") { visibility = [ ":*" ] include_dirs = [ "include", "${preferences_native_path}/include", ] } config("native_preferences_public_config") { visibility = [ "//foundation/distributeddatamgr/preferences:*" ] include_dirs = [ "include" ] } config("adaptor_config") { include_dirs = [ "//commonlibrary/c_utils/base/include" ] } ohos_shared_library("native_preferences") { all_dependent_configs = [ ":native_preferences_public_config" ] sources = [ "${preferences_native_path}/src/preferences_helper.cpp", "${preferences_native_path}/src/preferences_impl.cpp", "${preferences_native_path}/src/preferences_observer.cpp", "${preferences_native_path}/src/preferences_value.cpp", "${preferences_native_path}/src/preferences_xml_utils.cpp", "${preferences_native_path}/src/task_executor.cpp", ] configs = [ ":native_preferences_config" ] if (is_mingw || is_mac) { configs += [ ":adaptor_config" ] cflags_cc = [ "-std=c++17", "-stdlib=libc++", ] if (is_mac) { buildos = "mac" defines = [ "MAC_PLATFORM" ] } else { buildos = "windows" defines = [ "WINDOWS_PLATFORM" ] ldflags = [ "-lws2_32" ] } deps = [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${buildos}", "//third_party/libxml2:static_libxml2", ] } else { deps = [ "//third_party/libxml2:libxml2" ] external_deps = [ "c_utils:utils", "hilog_native:libhilog", "hitrace_native:hitrace_meter", ] } public_configs = [ ":native_preferences_public_config" ] subsystem_name = "distributeddatamgr" part_name = "preferences" }