xref: /aosp_15_r20/external/pigweed/third_party/re2/docs.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1.. _module-pw_third_party_re2:
2
3===
4RE2
5===
6The ``$dir_pw_third_party/re2/`` module provides build files to allow
7optionally including upstream RE2.
8
9.. _module-pw_third_party_re2-using_upstream:
10
11------------------
12Using upstream RE2
13------------------
14If you want to use RE2, you must do the following:
15
16Submodule
17=========
18Add RE2 to your workspace with the following command.
19
20.. code-block:: sh
21
22   git submodule add https://github.com/google/re2.git \
23     third_party/re2/src
24
25GN
26==
27* Set the GN var ``dir_pw_third_party_re2`` to the location of the
28  RE2 source.
29
30  If you used the command above, this will be
31  ``//third_party/re2/src``
32
33  This can be set in your args.gn or .gn file like:
34  ``dir_pw_third_party_re2 = "//third_party/re2/src"``
35
36Updating
37========
38The GN build files are generated from the third-party Bazel build files using
39$dir_pw_build/py/pw_build/generate_3p_gn.py.
40
41The script uses data taken from ``$dir_pw_third_party/re2/repo.json``.
42
43The script should be re-run whenever the submodule is updated or the JSON file
44is modified. Specify the location of the Bazel repository can be specified using
45the ``-w`` option, e.g.
46
47.. code-block:: sh
48
49   python pw_build/py/pw_build/generate_3p_gn.py \
50     -w third_party/re2/src
51
52Version
53=======
54The update script was last run for revision `c9cba76`_.
55
56.. _c9cba76: https://github.com/google/re2/tree/c9cba76063cf4235c1a15dd14a24a4ef8d623761
57