# Copyright (C) 2025 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("//developtools/hdc/hdc.gni")
config("hdc_config") {
include_dirs = [
"../src/common",
]
cflags_cc = [ "-std=c++17" ]
if (is_mingw) {
cflags_cc += [ "-Wno-inconsistent-dllimport" ] # in mingw some sec api will
# overwrite by utilsecurec
}
}
ohos_executable("hdc_credential_exec") {
if (hdc_feature_support_credential) {
use_exceptions = true
ldflags = [
"-Wl,--whole-archive",
"-ldl",
"-lrt",
"-Wl,--no-whole-archive",
]
libs = []
defines = []
configs = [ ":hdc_config" ]
deps = []
if (hdc_debug) {
defines += [ "HDC_DEBUG" ]
}
if (build_variant == "user") {
defines += [ "IS_RELEASE_VERSION" ]
}
sources = [
"main.cpp",
]
external_deps = [
"openssl:libcrypto_shared",
"bounds_checking_function:libsec_shared",
"libuv:uv",
]
if (product_name != "ohos-sdk") {
external_deps += [
"os_account:os_account_innerkits",
"os_account:account_iam_innerkits"
]
}
if (is_ohos) {
sources += [
"../src/common/base.cpp",
"../src/common/credential_message.cpp",
"../src/common/hdc_huks.cpp",
"../src/common/password.cpp",
"credential_base.cpp",
"hdc_subscriber.cpp",
"secret_manage.cpp"
]
external_deps += [ "huks:libhukssdk" ]
external_deps += [ "hilog:libhilog" ]
external_deps += [ "common_event_service:cesfwk_innerkits" ]
defines += [
"HDC_SUPPORT_ENCRYPT_PRIVATE_KEY",
"HDC_HILOG",
]
install_images = [ "system" ]
}
output_name = "hdc_credential"
}
subsystem_name = "developtools"
part_name = "hdc"
}
group ("hdc_credential") {
if (hdc_feature_support_credential) {
deps = [ ":hdc_credential_exec" ]
}
}