# Copyright (c) 2022 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("//third_party/bounds_checking_function/libsec_src.gni") import("$build_root/ark.gni") config("libsec_public_config") { include_dirs = [ "//third_party/bounds_checking_function/include" ] } ohos_static_library("libsec_static") { stack_protector_ret = false sources = libsec_sources public_configs = [ ":libsec_public_config" ] cflags = [ "-D_INC_STRING_S", "-D_INC_WCHAR_S", "-D_SECIMP=//", "-D_STDIO_S_DEFINED", "-D_INC_STDIO_S", "-D_INC_STDLIB_S", "-D_INC_MEMORY_S", ] } SEC_SHARED_SUBSYS_NAME = "thirdparty" SEC_SHARED_PART_NAME = "bounds_checking_function" ohos_shared_library("libsec_shared") { stack_protector_ret = false sources = libsec_sources public_configs = [ ":libsec_public_config" ] cflags = [ "-D_INC_STRING_S", "-D_INC_WCHAR_S", "-D_SECIMP=//", "-D_STDIO_S_DEFINED", "-D_INC_STDIO_S", "-D_INC_STDLIB_S", "-D_INC_MEMORY_S", ] part_name = "${SEC_SHARED_PART_NAME}" subsystem_name = "${SEC_SHARED_SUBSYS_NAME}" install_images = [ "system", "updater", ] } if (is_ohos && run_with_qemu) { copy("libsec_shared_for_qemu") { deps = [ ":libsec_shared" ] sources = [ "${root_out_dir}/${SEC_SHARED_SUBSYS_NAME}/${SEC_SHARED_PART_NAME}/libsec_shared.so" ] outputs = [ "${root_out_dir}/${so_dir_for_qemu}/lib/libsec_shared.so" ] } }