summaryrefslogtreecommitdiff
path: root/chromium/third_party/re2/BUILD.gn
blob: 5d12bd266d1d81fe79342d10d9d5898bc26ff6e7 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 2014 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/libfuzzer/fuzzer_test.gni")
import("//build/shim_headers.gni")

declare_args() {
  use_system_re2 = false
}

config("re2_config") {
  include_dirs = [ "src" ]
}

static_library("bundled_re2") {
  sources = [
    "src/re2/bitmap256.h",
    "src/re2/bitstate.cc",
    "src/re2/compile.cc",
    "src/re2/dfa.cc",
    "src/re2/filtered_re2.cc",
    "src/re2/filtered_re2.h",
    "src/re2/mimics_pcre.cc",
    "src/re2/nfa.cc",
    "src/re2/onepass.cc",
    "src/re2/parse.cc",
    "src/re2/perl_groups.cc",
    "src/re2/prefilter.cc",
    "src/re2/prefilter.h",
    "src/re2/prefilter_tree.cc",
    "src/re2/prefilter_tree.h",
    "src/re2/prog.cc",
    "src/re2/prog.h",
    "src/re2/re2.cc",
    "src/re2/re2.h",
    "src/re2/regexp.cc",
    "src/re2/regexp.h",
    "src/re2/set.cc",
    "src/re2/set.h",
    "src/re2/simplify.cc",
    "src/re2/stringpiece.cc",
    "src/re2/stringpiece.h",
    "src/re2/tostring.cc",
    "src/re2/unicode_casefold.cc",
    "src/re2/unicode_casefold.h",
    "src/re2/unicode_groups.cc",
    "src/re2/unicode_groups.h",
    "src/re2/walker-inl.h",
    "src/util/flags.h",
    "src/util/logging.h",
    "src/util/mix.h",
    "src/util/mutex.h",
    "src/util/rune.cc",
    "src/util/sparse_array.h",
    "src/util/sparse_set.h",
    "src/util/strutil.cc",
    "src/util/strutil.h",
    "src/util/utf.h",
    "src/util/util.h",
  ]

  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [ "//build/config/compiler:no_chromium_code" ]
  public_configs = [ ":re2_config" ]
}

fuzzer_test("third_party_re2_fuzzer") {
  sources = [
    "src/re2/fuzzing/re2_fuzzer.cc",
  ]
  deps = [
    ":re2",
  ]
}

shim_headers("re2_shim") {
  root_path = "src/re2"
  prefix = "re2/"
  headers = [
    "filtered_re2.h",
    "re2.h",
    "set.h",
    "stringpiece.h"
  ]
}

source_set("system_re2") {
  deps = [ ":re2_shim" ]
  libs = [ "re2" ]
}

group("re2") {
  if (use_system_re2) {
    public_deps = [ ":system_re2" ]
  } else {
    public_deps = [ ":bundled_re2" ]
  }
}