1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88

media / cdm / win / test / BUILD.gn [blame]

# Copyright 2022 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/features.gni")
import("//testing/test.gni")

config("clang_config") {
  cflags = [
    # ActivatableClass omits optional braces.
    "-Wno-missing-braces",

    # ActivatableClass uses WrlCreatorMapIncludePragma macro which has a
    # semicolon at the end in 10.0.19041.0/winrt/wrl/module.h.
    "-Wno-c++98-compat-extra-semi",
  ]
}

group("all") {
  testonly = true
  deps = [ ":media_foundation_clear_key_cdm" ]
}

source_set("media_foundation_clear_key") {
  sources = [
    "media_foundation_clear_key_activate.cc",
    "media_foundation_clear_key_activate.h",
    "media_foundation_clear_key_cdm.cc",
    "media_foundation_clear_key_cdm.h",
    "media_foundation_clear_key_cdm_access.cc",
    "media_foundation_clear_key_cdm_access.h",
    "media_foundation_clear_key_cdm_factory.cc",
    "media_foundation_clear_key_cdm_factory.h",
    "media_foundation_clear_key_content_enabler.cc",
    "media_foundation_clear_key_content_enabler.h",
    "media_foundation_clear_key_decryptor.cc",
    "media_foundation_clear_key_decryptor.h",
    "media_foundation_clear_key_guids.h",
    "media_foundation_clear_key_input_trust_authority.cc",
    "media_foundation_clear_key_input_trust_authority.h",
    "media_foundation_clear_key_session.cc",
    "media_foundation_clear_key_session.h",
    "media_foundation_clear_key_trusted_input.cc",
    "media_foundation_clear_key_trusted_input.h",
    "mock_media_protection_pmp_server.cc",
    "mock_media_protection_pmp_server.h",
  ]

  configs += [
    ":clang_config",  # Needed by media_foundation_clear_key_cdm_factory.cc
  ]

  deps = [
    "//base",
    "//media",
    "//media/cdm:clear_key_cdm_common",
  ]

  libs = [
    "WindowsApp.lib",
    "mfuuid.lib",
    "mfplat.lib",
    "Ole32.lib",
    "Rtworkq.lib",
  ]
}

shared_library("media_foundation_clear_key_cdm") {
  output_dir = "$root_out_dir"
  output_name = "MediaFoundation.ClearKey.CDM"

  sources = [
    "dll_main.cc",
    "media_foundation_clear_key_cdm_version.rc",
  ]

  deps = [
    ":media_foundation_clear_key",
    "//base",
    "//media",
  ]

  inputs = [ "dll_export.def" ]

  def_file = rebase_path("dll_export.def", root_build_dir)

  ldflags = [ "/DEF:${def_file}" ]
}