summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/webrtc/build/config/fuchsia/BUILD.gn
blob: 1f8ee1a0e1cbd18be1f1379d091dfe58878c49a7 (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
# Copyright 2017 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/fuchsia/config.gni")
import("//build/config/sysroot.gni")

assert(is_fuchsia)
assert(is_posix)

config("compiler") {
  defines = [ "SYSROOT_VERSION=$sysroot_version" ]
  cflags = []
  ldflags = []
  if (current_cpu == "arm64") {
    cflags += [ "--target=aarch64-fuchsia" ]
    ldflags += [ "--target=aarch64-fuchsia" ]
  } else if (current_cpu == "x64") {
    cflags += [ "--target=x86_64-fuchsia" ]
    ldflags += [ "--target=x86_64-fuchsia" ]
  } else {
    assert(false, "Unsupported architecture")
  }
  asmflags = cflags

  # TODO(thakis): Once Fuchsia's libclang_rt.builtin no longer has upstream
  # patches, we might want to make tools/clang/scripts/update.py build it
  # and bundle it with the clang package instead of using the library from
  # the SDK, https://crbug.com/724204
  ldflags += [
    "-resource-dir",
    rebase_path(fuchsia_sdk, root_build_dir) + "/toolchain_libs/clang/5.0.0",
  ]

  libs = [
    "mxio",
    "magenta",
    "unwind",
  ]
}