summaryrefslogtreecommitdiffstats
path: root/third_party/android_platform/BUILD.gn
blob: c0030d6b9109c99c28be56a2b1abdea640e0bd37 (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
# Copyright 2015 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("//testing/test.gni")
import("config.gni")

if (current_toolchain == host_toolchain) {
  gypi_values = exec_script("//build/gypi_to_gn.py",
                            [ rebase_path("relocation_packer.gyp") ],
                            "scope",
                            [ "relocation_packer.gyp" ])

  # GYP: //third_party/android_platform/relocation_packer.gyp:android_lib_relocation_packer
  source_set("android_lib_relocation_packer") {
    deps = [
      "//third_party/elfutils:libelf",
    ]
    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [ "//build/config/compiler:no_chromium_code" ]
    sources = gypi_values.relocation_packer_sources
  }

  # GYP: //third_party/android_platform/relocation_packer.gyp:android_relocation_packer
  executable("android_relocation_packer") {
    deps = [
      ":android_lib_relocation_packer",
      "//build/config/sanitizers:deps",
      "//third_party/elfutils:libelf",
    ]
    sources = gypi_values.relocation_packer_main_source
  }

  copy("copy_android_relocation_packer_test_data") {
    sources = gypi_values.relocation_packer_test_data_sources
    outputs = [
      "$root_out_dir/{{source_file_part}}",
    ]
  }

  # GYP: //third_party/android_platform/relocation_packer.gyp:android_relocation_packer_unittests
  test("android_relocation_packer_unittests") {
    deps = [
      ":android_lib_relocation_packer",
      ":copy_android_relocation_packer_test_data",
      "//testing/gtest",
    ]
    sources = gypi_values.relocation_packer_test_sources
  }
}

if (is_android) {
  import("//build/config/android/rules.gni")

  wrapper_script("stack_wrapper") {
    target = "//third_party/android_platform/development/scripts/stack"
  }
}