# 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("config.gni") # compile options for gcov config("hiprofiler_test_config") { cflags = [ "-std=c++17" ] ldflags = [] if (enable_coverage) { # clang coverage options: if (is_ohos) { cflags += [ "-fprofile-arcs", "-ftest-coverage", ] ldflags += [ "--coverage" ] } cflags += [ "-mllvm", "-limited-coverage-experimental=true", "-fno-use-cxa-atexit", ] } } config("hiprofiler_base_config") { include_dirs = [ "include", "//utils/native/base/include", ] } ohos_source_set("hiprofiler_base") { part_name = "profiler" sources = [ "src/epoll_event_poller.cpp", "src/event_notifier.cpp", "src/i_semaphore.cpp", "src/posix_semaphore.cpp", "src/pthread_semaphore.cpp", "src/schedule_task_manager.cpp", "src/std_semaphore.cpp", ] public_configs = [ ":hiprofiler_test_config", ":hiprofiler_base_config", ] public_deps = [ "//utils/native/base:utilsecurec" ] if (current_toolchain != host_toolchain) { defines = [ "HAVE_HILOG" ] if (build_l2) { external_deps = [ "shared_library:libhilog" ] } else { external_deps = [ "hiviewdfx_hilog_native:libhilog" ] } } }