chromium/chrome/common/win/BUILD.gn

# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/sanitizers/sanitizers.gni")
import("//build/win/message_compiler.gni")
import("//chrome/process_version_rc_template.gni")

message_compiler("eventlog_messages") {
  visibility = [
    ":eventlog_provider",
    "//chrome/common:common_lib",
  ]

  sources = [ "eventlog_messages.mc" ]

  user_mode_logging = false
  compile_generated_code = false
}

process_version_rc_template("eventlog_provider_dll_version") {
  sources = [ "eventlog_provider.ver" ]
  output = "$target_gen_dir/eventlog_provider_dll_version.rc"
}

shared_library("eventlog_provider") {
  sources = [
    "$root_gen_dir/chrome/common/win/eventlog_messages.rc",
    "eventlog_provider.cc",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  if (!is_asan && !use_clang_profiling) {
    no_default_deps = true
    ldflags = [ "/NOENTRY" ]
  }

  deps = [ ":eventlog_provider_dll_version" ]
  public_deps = [ ":eventlog_messages" ]
}

# The delay load hook must be a source_set to ensure that it has external
# linkage and will correctly emplace over the correct symbols in delayimp.lib at
# link time.
source_set("delay_load_hooks") {
  sources = [
    "delay_load_failure_hook.cc",
    "delay_load_notify_hook.cc",
    "delay_load_notify_hook.h",
  ]
  configs += [ "//build/config/compiler:wexit_time_destructors" ]
  deps = [
    ":delay_load_failure_support",
    "//base",
  ]
}

source_set("delay_load_failure_support") {
  sources = [
    "delay_load_failure_support.cc",
    "delay_load_failure_support.h",
  ]
  configs += [ "//build/config/compiler:wexit_time_destructors" ]
  deps = [ "//base" ]
}