aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/README5
-rw-r--r--cpp/libaddressinput.gyp1
-rw-r--r--cpp/re2.gyp37
3 files changed, 42 insertions, 1 deletions
diff --git a/cpp/README b/cpp/README
index 4f27635..8e60fc7 100644
--- a/cpp/README
+++ b/cpp/README
@@ -24,11 +24,12 @@ GYP: Generates the build files.
Ninja: Executes the build files.
GTest: Used for unit tests.
Python: Used by GRIT, which generates localization files.
+RE2: Used for validating postal code format.
Most of these packages are available on Debian-like distributions. You can
install them with this command:
-$ sudo apt-get install gyp ninja-build libgtest-dev python
+$ sudo apt-get install gyp ninja-build libgtest-dev python libre2-dev
Make sure that your version of GYP is at least 0.1~svn1395. Older versions of
GYP do not generate the Ninja build files correctly. You can download a
@@ -41,6 +42,7 @@ http://packages.ubuntu.com/saucy/gyp
http://packages.ubuntu.com/saucy/ninja-build
http://packages.ubuntu.com/saucy/libgtest-dev
http://packages.ubuntu.com/saucy/python
+http://packages.debian.org/experimental/libre2-dev
Alternatively, you can download, build, and install these tools and libraries
from source code. Their home pages contain information on how to accomplish
@@ -50,6 +52,7 @@ https://code.google.com/p/gyp/
http://martine.github.io/ninja/
https://code.google.com/p/googletest/
http://python.org/
+https://code.google.com/p/re2/
Build
=====
diff --git a/cpp/libaddressinput.gyp b/cpp/libaddressinput.gyp
index 1058b70..fcd2fe6 100644
--- a/cpp/libaddressinput.gyp
+++ b/cpp/libaddressinput.gyp
@@ -49,6 +49,7 @@
'dependencies': [
'grit.gyp:generated_messages',
'rapidjson.gyp:rapidjson',
+ 're2.gyp:re2',
],
},
{
diff --git a/cpp/re2.gyp b/cpp/re2.gyp
new file mode 100644
index 0000000..961178c
--- /dev/null
+++ b/cpp/re2.gyp
@@ -0,0 +1,37 @@
+# Copyright (C) 2013 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+{
+ 'variables': {
+ 're2_dir%': '/usr/include',
+ 're2_lib%': '/usr/lib/libre2.a',
+ },
+ 'targets': [
+ {
+ 'target_name': 're2',
+ 'type': 'none',
+ 'all_dependent_settings': {
+ 'include_dirs': [
+ '<(re2_dir)',
+ ],
+ 'conditions': [
+ ['"<(component)" != "shared_library"', {
+ 'libraries': [
+ '<(re2_lib)',
+ ],
+ }],
+ ],
+ },
+ },
+ ],
+}