aboutsummaryrefslogtreecommitdiff
path: root/cast/standalone_receiver/BUILD.gn
blob: 23d394ac61a635a71b045715f063191f5a108cbd (plain)
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
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/external_libraries.gni")
import("//build_overrides/build.gni")

# Define the executable target only when the build is configured to use the
# standalone platform implementation; since this is itself a standalone
# application.
#
# See [external_libraries.md](../../build/config/external_libraries.md) for more information.
if (!build_with_chromium) {
  shared_sources = [
    "cast_service.cc",
    "cast_service.h",
    "mirroring_application.cc",
    "mirroring_application.h",
    "simple_remoting_receiver.cc",
    "simple_remoting_receiver.h",
    "streaming_playback_controller.cc",
    "streaming_playback_controller.h",
  ]

  shared_deps = [
    "../../discovery:dnssd",
    "../../discovery:public",
    "../../platform:standalone_impl",
    "../common:public",
    "../receiver:agent",
    "../receiver:channel",
    "../streaming:receiver",
  ]

  have_external_libs = have_ffmpeg && have_libsdl2

  if (have_external_libs) {
    source_set("standalone_receiver_sdl") {
      sources = shared_sources
      deps = shared_deps

      defines = [ "CAST_STANDALONE_RECEIVER_HAVE_EXTERNAL_LIBS" ]
      sources += [
        "avcodec_glue.h",
        "decoder.cc",
        "decoder.h",
        "sdl_audio_player.cc",
        "sdl_audio_player.h",
        "sdl_glue.cc",
        "sdl_glue.h",
        "sdl_player_base.cc",
        "sdl_player_base.h",
        "sdl_video_player.cc",
        "sdl_video_player.h",
      ]
      include_dirs = ffmpeg_include_dirs + libsdl2_include_dirs
      lib_dirs = ffmpeg_lib_dirs + libsdl2_lib_dirs
      libs = ffmpeg_libs + libsdl2_libs
    }
  }

  source_set("standalone_receiver_dummy") {
    sources = shared_sources
    deps = shared_deps

    sources += [
      "dummy_player.cc",
      "dummy_player.h",
    ]
  }

  executable("cast_receiver") {
    sources = [ "main.cc" ]

    deps = shared_deps
    configs += [ "../common:certificate_config" ]

    if (have_external_libs) {
      deps += [ ":standalone_receiver_sdl" ]
    } else {
      deps += [ ":standalone_receiver_dummy" ]
    }
  }
}