Skip to content

Commit

Permalink
Fix re2 compilation when older system version installed
Browse files Browse the repository at this point in the history
re2 previously failed to compile if:

1. An old `re2` version is installed with a non-standard system
prefix, such as `/opt/local`.
2. The environment variable is set: `CPPFLAGS=-I/opt/local/include`.

Running `make` would result in function prototype mismatches because
the Makefile would previously attempt to use the headers from
`/opt/local/include/re2` before the `third_party/re2/re2`
directory.

To ensure the current directories receive priority, include the
relevant re2 directories in the include path.
  • Loading branch information
stanhu committed Mar 9, 2023
1 parent 7b3977e commit 37a6ff0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions templates/Makefile.template
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@
RE2_DEP = $(LIBDIR)/$(CONFIG)/libre2.a
RE2_MERGE_OBJS = $(LIBRE2_OBJS)
RE2_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libre2.a
CPPFLAGS := -Ithird_party/re2 $(CPPFLAGS)

# Setup upb dependency

Expand Down

0 comments on commit 37a6ff0

Please sign in to comment.