• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/external_libraries.gni")
6import("//build_overrides/build.gni")
7
8# Define the executable target only when the build is configured to use the
9# standalone platform implementation; since this is itself a standalone
10# application.
11if (!build_with_chromium) {
12  declare_args() {
13    have_external_libs = have_ffmpeg && have_libopus && have_libvpx
14  }
15
16  config("standalone_external_libs") {
17    defines = []
18    if (have_external_libs) {
19      defines += [ "CAST_STANDALONE_SENDER_HAVE_EXTERNAL_LIBS" ]
20    }
21    if (have_libaom) {
22      defines += [ "CAST_STANDALONE_SENDER_HAVE_LIBAOM" ]
23    }
24  }
25
26  executable("cast_sender") {
27    deps = [
28      "../../discovery:dnssd",
29      "../../discovery:public",
30      "../../platform",
31      "../../platform:standalone_impl",
32      "../../third_party/aomedia",
33      "../../third_party/jsoncpp",
34      "../../util",
35      "../common:public",
36      "../common/channel/proto:channel_proto",
37      "../sender:channel",
38      "../streaming:common",
39      "../streaming:sender",
40    ]
41
42    sources = [ "main.cc" ]
43    include_dirs = []
44    lib_dirs = []
45    libs = []
46    if (have_external_libs) {
47      sources += [
48        "connection_settings.h",
49        "ffmpeg_glue.cc",
50        "ffmpeg_glue.h",
51        "looping_file_cast_agent.cc",
52        "looping_file_cast_agent.h",
53        "looping_file_sender.cc",
54        "looping_file_sender.h",
55        "receiver_chooser.cc",
56        "receiver_chooser.h",
57        "remoting_sender.cc",
58        "remoting_sender.h",
59        "simulated_capturer.cc",
60        "simulated_capturer.h",
61        "streaming_encoder_util.cc",
62        "streaming_encoder_util.h",
63        "streaming_opus_encoder.cc",
64        "streaming_opus_encoder.h",
65        "streaming_video_encoder.cc",
66        "streaming_video_encoder.h",
67        "streaming_vpx_encoder.cc",
68        "streaming_vpx_encoder.h",
69      ]
70
71      include_dirs +=
72          ffmpeg_include_dirs + libopus_include_dirs + libvpx_include_dirs
73      lib_dirs += ffmpeg_lib_dirs + libopus_lib_dirs + libvpx_lib_dirs
74      libs += ffmpeg_libs + libopus_libs + libvpx_libs
75
76      # LibAOM support currently recommends building from source, so is included
77      # separately here.
78      if (have_libaom) {
79        sources += [
80          "streaming_av1_encoder.cc",
81          "streaming_av1_encoder.h",
82        ]
83
84        include_dirs += libaom_include_dirs
85        lib_dirs += libaom_lib_dirs
86        libs += libaom_libs
87      }
88    }
89
90    configs += [ "../common:certificate_config" ]
91
92    public_configs = [
93      "../../build:openscreen_include_dirs",
94      ":standalone_external_libs",
95    ]
96  }
97}
98