Build error when including RE2

145 views
Skip to first unread message

Alesandro Ortiz

unread,
Jun 29, 2024, 1:22:51 PMJun 29
to Chromium-dev
Hello,

I'm trying to use RE2 in components/ntp_tiles/most_visited_sites.cc but when I include third_party/re2/src/re2/re2.h, the compiler throws an error about "re2/stringpiece.h". Including re2.h in either the .cc or .h file doesn't seem to change behavior.

Do I need to update something else for the include to work?

The include seems to be used elsewhere in Chromium as shown below, so I'm not sure why it doesn't work. This is a Windows cross build on a Linux host.

Added line in either most_visited_sites.cc or .h:
#include "third_party/re2/src/re2/re2.h"

Error (full log attached):
In file included from ../../components/ntp_tiles/most_visited_sites.cc:37:
../../third_party/re2/src/re2/re2.h(223,10): fatal error: 're2/stringpiece.h' file not found
  223 | #include "re2/stringpiece.h"
      |          ^~~~~~~~~~~~~~~~~~~

target_os = "win"
target_cpu = "x64"
is_debug = false
is_component_build = false
enable_nacl = false
symbol_level = 0
blink_symbol_level = 0
v8_symbol_level = 0

Any help is much appreciated.

Regards,
Alesandro
re2-build-error.log

Lei Zhang

unread,
Jun 29, 2024, 1:38:32 PMJun 29
to ales...@alesandroortiz.com, Chromium-dev
You need to add RE2's build target as a deps entry in the appropriate BUILD.gn.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/0fd4acda-ef98-40ca-b343-10b9c31d5bffn%40chromium.org.

Alesandro Ortiz

unread,
Jul 1, 2024, 1:51:05 PMJul 1
to Chromium-dev, Lei Zhang, Chromium-dev, ales...@alesandroortiz.com
Ah, that worked, thanks Lei. I thought I had already tried adding the deps entry, but I must have added the wrong value or updated the wrong file.

Thanks again!

Regards,
Alesandro

Reply all
Reply to author
Forward
0 new messages